Documentation ¶
Index ¶
Constants ¶
const (
// RFC3164DelimiterPrefix indicates the start of a syslog line
RFC3164DelimiterPrefix = `<-?[0-9]{1,3}>`
)
const (
// RFC5424DelimiterPrefix indicates the start of a syslog line
RFC5424DelimiterPrefix = `<[0-9]{1,3}>[0-9]\s`
)
Variables ¶
This section is empty.
Functions ¶
func ValidFormat ¶
ValidFormat returns if the given format matches one of the possible formats.
Types ¶
type Collector ¶
Collector specifies the interface all network collectors must implement.
func NewCollector ¶
NewCollector returns a network collector of the specified type, that will bind to the given inteface on Start(). If config is non-nil, a secure Collector will be returned. Secure Collectors require the protocol be TCP.
type Parser ¶
type Parser struct { Raw []byte Result map[string]interface{} // contains filtered or unexported fields }
A Parser parses the raw input as a map with a timestamp field.
type RFC3164 ¶
type RFC3164 struct {
// contains filtered or unexported fields
}
RFC3164 represents a parser for RFC3164-compliant log messages
type RFC3164Delimiter ¶
type RFC3164Delimiter struct {
// contains filtered or unexported fields
}
A RFC3164Delimiter detects when Syslog lines start.
func NewRFC3164Delimiter ¶
func NewRFC3164Delimiter(maxSize int) *RFC3164Delimiter
NewRFC3164Delimiter returns an initialized RFC3164Delimiter.
func (*RFC3164Delimiter) Push ¶
func (s *RFC3164Delimiter) Push(b byte) (string, bool)
Push a byte into the RFC3164Delimiter. If the byte results in a a new RFC3164 message, it'll be flagged via the bool.
func (*RFC3164Delimiter) Vestige ¶
func (s *RFC3164Delimiter) Vestige() (string, bool)
Vestige returns the bytes which have been pushed to RFC3164Delimiter, since the last RFC3164 message was returned, but only if the buffer appears to be a valid syslog message.
type RFC5424 ¶
type RFC5424 struct {
// contains filtered or unexported fields
}
RFC5424 represents a parser for RFC5424-compliant log messages
type RFC5424Delimiter ¶
type RFC5424Delimiter struct {
// contains filtered or unexported fields
}
A RFC5424Delimiter detects when Syslog lines start.
func NewRFC5424Delimiter ¶
func NewRFC5424Delimiter(maxSize int) *RFC5424Delimiter
NewRFC5424Delimiter returns an initialized RFC5424Delimiter.
func (*RFC5424Delimiter) Push ¶
func (s *RFC5424Delimiter) Push(b byte) (string, bool)
Push a byte into the RFC5424Delimiter. If the byte results in a a new Syslog message, it'll be flagged via the bool.
func (*RFC5424Delimiter) Vestige ¶
func (s *RFC5424Delimiter) Vestige() (string, bool)
Vestige returns the bytes which have been pushed to RFC5424Delimiter, since the last Syslog message was returned, but only if the buffer appears to be a valid syslog message.
type TCPCollector ¶
type TCPCollector struct {
// contains filtered or unexported fields
}
TCPCollector represents a network collector that accepts and handler TCP connections.
func (*TCPCollector) Addr ¶
func (s *TCPCollector) Addr() net.Addr
Addr returns the net.Addr that the Collector is bound to, in a race-say manner.
type UDPCollector ¶
type UDPCollector struct {
// contains filtered or unexported fields
}
UDPCollector represents a network collector that accepts UDP packets.
func (*UDPCollector) Addr ¶
func (s *UDPCollector) Addr() net.Addr
Addr returns the net.Addr to which the UDP collector is bound.