Documentation
¶
Index ¶
Constants ¶
const FlexibleSyslogTimeFormat = "2006-01-02T15:04:05.999999Z07:00"
FlexibleSyslogTimeFormat accepts both 'Z' and TZ notation for event time.
const L15Error = "L15: Error displaying log lines. Please try again."
L15Error is the message returned with an L15 error
const MaxFrameLength = 10240
MaxFrameLength is the maximum message size to parse
const OptimalFrameLength = 1024
OptimalFrameLength is the initial buffer size for scanning
const SyslogTimeFormat = "2006-01-02T15:04:05.999999-07:00"
SyslogTimeFormat defines the exact time format used in our logs.
Variables ¶
var ErrBadFrame = errors.New("bad frame")
ErrBadFrame is returned when the scanner cannot parse syslog message boundaries
var ErrInvalidMessage = errors.New("invalid message")
ErrInvalidMessage returned when trying to encode an invalid syslog message
var ErrInvalidStructuredData = errors.New("invalid structured data")
ErrInvalidStructuredData is returned when structure data has any value other than '-' (blank) We do not
Functions ¶
Types ¶
type Encoder ¶
Encoder abstracts away how messages are written out
type Message ¶
type Message struct { Timestamp time.Time Hostname string Application string Process string ID string Message string Version uint16 Priority uint8 RFCCompliant bool }
Message is a syslog message
type Scanner ¶
Scanner is the general purpose primitive for parsing message bodies coming from log-shuttle, logfwd, logplex and all sorts of logging components.
func NewDrainScanner ¶
func NewDrainScanner(r io.ReadCloser) Scanner
NewDrainScanner returns a scanner for use with drain endpoints. The primary difference is that it's lose and doesn't check for structured data.
func NewScanner ¶
NewScanner is a syslog octet frame stream parser