Documentation ¶
Index ¶
Constants ¶
const (
SYSLOG_DELIMITER = `<[0-9]{1,3}>[0-9]\s`
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Delimiter ¶
type Delimiter struct {
// contains filtered or unexported fields
}
A Delimiter detects when Syslog lines start.
func NewDelimiter ¶
NewDelimiter returns an initialized Delimiter.
func (*Delimiter) Push ¶
Push a byte into the Delimiter. If the byte results in a a new Syslog message, it'll be flagged via the bool.
type ParsedMessage ¶
type ParsedMessage struct { Priority int `json:"priority"` Version int `json:"version"` Timestamp string `json:"timestamp"` Host string `json:"host"` App string `json:"app"` Pid int `json:"pid"` MsgId string `json:"msgid"` Message string `json:"message"` }
ParsedMessage represents a fully parsed Syslog message.
type Rfc5424Parser ¶
type Rfc5424Parser struct {
// contains filtered or unexported fields
}
A Rfc5424Parser parses Syslog messages.
func NewRfc5424Parser ¶
func NewRfc5424Parser() *Rfc5424Parser
NewRfc5424Parser Returns an initialized Rfc5424Parser.
func (*Rfc5424Parser) Parse ¶
func (p *Rfc5424Parser) Parse(raw string) *ParsedMessage
Parse takes a raw message and returns a parsed message. If no match, nil is returned.
func (*Rfc5424Parser) Statistics ¶
func (p *Rfc5424Parser) Statistics() (metrics.Registry, error)
Statistics returns an object storing statistics, which supports JSON marshalling.
func (*Rfc5424Parser) StreamingParse ¶
func (p *Rfc5424Parser) StreamingParse(in chan string) (chan string, error)
StreamingParse emits parsed Syslog messages on the returned channel. If there are any parsing errors, the message is dropped.
type TcpServer ¶
type TcpServer struct {
// contains filtered or unexported fields
}
A TcpServer binds to the supplied interface and receives Syslog messages.
func (*TcpServer) Start ¶
Start instructs the TcpServer to bind to the interface and accept connections.
func (*TcpServer) Statistics ¶
Statistics returns an object storing statistics, which supports JSON marshalling.
type UdpServer ¶
type UdpServer struct {
// contains filtered or unexported fields
}
A UdpServer listens to the supplied interface and receives Syslog messages.
func (*UdpServer) Start ¶
Start instructs the UdpServer to start reading packets from the interface.
func (*UdpServer) Statistics ¶
Statistics returns an object storing statistics, which supports JSON marshalling.