qtypes_messages

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2018 License: Apache-2.0 Imports: 10 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sha1HashString

func Sha1HashString(s string) string

Types

type Base

type Base struct {
	BaseVersion   string
	ID            string
	Time          time.Time
	SourceID      int
	SourcePath    []string
	SourceSuccess bool
	Tags          map[string]string // Additional KV
	Msg           string
}

func NewBase

func NewBase(src string) Base

func NewBaseFromBase

func NewBaseFromBase(src string, b Base) Base

func NewBaseMessage added in v0.1.9

func NewBaseMessage(src, msg string) Base

func NewTimeBaseMessage added in v0.1.9

func NewTimeBaseMessage(src string, t time.Time, msg string) Base

func NewTimedBase

func NewTimedBase(src string, t time.Time) Base

func (*Base) AppendSource

func (b *Base) AppendSource(src string)

func (*Base) GenDefaultID

func (b *Base) GenDefaultID() string

GenDefaultID uses "<source>-<time.UnixNano()>" and does a sha1 hash.

func (*Base) GetLastSource

func (b *Base) GetLastSource() string

func (*Base) GetMessageDigest

func (b *Base) GetMessageDigest() string

func (*Base) GetTimeRFC

func (b *Base) GetTimeRFC() string

func (*Base) GetTimeUnix

func (b *Base) GetTimeUnix() int64

func (*Base) GetTimeUnixNano

func (b *Base) GetTimeUnixNano() int64

func (*Base) InputsMatch

func (b *Base) InputsMatch(inputs []string) bool

func (*Base) IsLastSource

func (b *Base) IsLastSource(src string) bool

func (*Base) StopProcessing

func (b *Base) StopProcessing(p *qtypes_plugin.Plugin, allowEmptyInput bool) bool

func (*Base) ToFlatJSON added in v0.1.9

func (b *Base) ToFlatJSON() map[string]interface{}

func (*Base) ToJSON added in v0.1.2

func (b *Base) ToJSON() map[string]interface{}

type ContainerMessage added in v0.1.6

type ContainerMessage struct {
	Base
	Container types.ContainerJSON
	Engine    types.Info // TODO:
}

func NewContainerMessage added in v0.1.6

func NewContainerMessage(base Base, cnt *types.ContainerJSON) ContainerMessage

func (*ContainerMessage) AddEngineInfo added in v0.1.6

func (cm *ContainerMessage) AddEngineInfo(e *types.Info)

func (*ContainerMessage) GenContainerMsgID added in v0.1.6

func (c *ContainerMessage) GenContainerMsgID() string

GenContainerMsgID uses "<container_id>-<time.UnixNano()>-<MSG>" and does a sha1 hash.

func (*ContainerMessage) GetContainerName added in v0.1.6

func (c *ContainerMessage) GetContainerName() string

type Message added in v0.1.3

type Message struct {
	Base
	Message string
}

func NewMessage added in v0.1.3

func NewMessage(b Base, msg string) Message

func (*Message) ParseJsonMap added in v0.1.7

func (m *Message) ParseJsonMap(p *qtypes_plugin.Plugin, keys mapset.Set, kv map[string]string) map[string]string

ParseJSONMap iterates over set of potential keys and if unmarshalls the string value of all keys into a new map.

func (*Message) ToStringRFC54242 added in v0.1.8

func (m *Message) ToStringRFC54242() (res string, err error)

ToStringRFC54242 returns a string in RFC5424 format

type SyslogMessage added in v0.1.9

type SyslogMessage struct {
	Base
	Syslog qtypes_syslog.Syslog
}

func NewSyslogMessage added in v0.1.9

func NewSyslogMessage(b Base, sl qtypes_syslog.Syslog) SyslogMessage

func (*SyslogMessage) ToRFC5424 added in v0.1.9

func (sm *SyslogMessage) ToRFC5424() (str string, err error)

Jump to

Keyboard shortcuts

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