Documentation ¶
Index ¶
- func BytesToString(data []byte) string
- func NewHumioAdapter(route *router.Route) (router.LogAdapter, error)
- type FieldTemplates
- type Format
- type HumioAdapter
- type HumioMessage
- type HumioMessageEvent
- type Message
- func (m *Message) ContainerName() string
- func (m *Message) ContainerNameSplitN(sep string, n int) []string
- func (m *Message) Hostname() string
- func (m *Message) Priority() syslog.Priority
- func (m *Message) Render(format Format, tmpl *FieldTemplates) ([]byte, error)
- func (m *Message) Timestamp() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToString ¶ added in v0.0.2
func NewHumioAdapter ¶
func NewHumioAdapter(route *router.Route) (router.LogAdapter, error)
NewHumioAdapter creates an HumioAdapter
Types ¶
type FieldTemplates ¶ added in v0.0.2
type FieldTemplates struct {
// contains filtered or unexported fields
}
FieldTemplates for rendering Syslog messages
type Format ¶ added in v0.0.2
type Format string
Format represents the RFC spec to use for messages
const ( // Rfc5424Format is the modern syslog protocol format. https://tools.ietf.org/html/rfc5424 Rfc5424Format Format = "rfc5424" // Rfc3164Format is the legacy BSD syslog protocol format. https://tools.ietf.org/html/rfc3164 Rfc3164Format Format = "rfc3164" )
type HumioAdapter ¶
type HumioAdapter struct {
// contains filtered or unexported fields
}
HumioAdapter is an adapter that POSTs logs to an HTTP endpoint
func (*HumioAdapter) Stream ¶
func (a *HumioAdapter) Stream(logstream chan *router.Message)
Stream implements the router.LogAdapter interface
type HumioMessage ¶
type HumioMessage struct { Time string `json:"time"` Source string `json:"source"` SourceType string `json:"sourcetype"` Hostname string `json:"host"` Event HumioMessageEvent `json:"event"` }
HumioMessage is a simple JSON representation of the log message.
type HumioMessageEvent ¶
type Message ¶ added in v0.0.2
Message extends router.Message for the syslog standard
func (*Message) ContainerName ¶ added in v0.0.2
ContainerName returns the message's container name
func (*Message) ContainerNameSplitN ¶ added in v0.0.2
ContainerNameSplitN returns the message's container name sliced at most "n" times using "sep"
func (*Message) Priority ¶ added in v0.0.2
Priority returns a syslog.Priority based on the message source
Click to show internal directories.
Click to hide internal directories.