graylog

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2020 License: MIT Imports: 6 Imported by: 0

README

Graylog library

Simple library for sending messages to graylog via UDP using gelf

To do:

  • fix graylog bug with numbers interpretation
  • functions description
  • tests
  • examples

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitGraylog

func InitGraylog(addr string, port uint)

func Send

func Send(shortMessage string, fullMessage string, level uint, extra map[string]interface{})

Types

type Endpoint

type Endpoint struct {
	Address string
	Port    uint
}

Endpoint represents a graylog endpoint

type Graylog

type Graylog struct {
	Client *net.UDPConn
}

Graylog represents an established graylog connection

type Message

type Message struct {
	Version      string                 `json:"version"`
	Host         string                 `json:"host"`
	ShortMessage string                 `json:"short_message"`
	FullMessage  string                 `json:"full_message,omitempty"`
	Timestamp    int64                  `json:"timestamp,omitempty"`
	Level        uint                   `json:"level,omitempty"`
	Extra        map[string]interface{} `json:"-"`
}

Message represents a GELF formated message

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL