Documentation ¶
Index ¶
Examples ¶
Constants ¶
View Source
const (
NILVALUE = '-'
)
Variables ¶
View Source
var ( ErrYearInvalid = &syslogparser.ParserError{"Invalid year in timestamp"} ErrMonthInvalid = &syslogparser.ParserError{"Invalid month in timestamp"} ErrDayInvalid = &syslogparser.ParserError{"Invalid day in timestamp"} ErrHourInvalid = &syslogparser.ParserError{"Invalid hour in timestamp"} ErrMinuteInvalid = &syslogparser.ParserError{"Invalid minute in timestamp"} ErrSecondInvalid = &syslogparser.ParserError{"Invalid second in timestamp"} ErrSecFracInvalid = &syslogparser.ParserError{"Invalid fraction of second in timestamp"} ErrTimeZoneInvalid = &syslogparser.ParserError{"Invalid time zone in timestamp"} ErrInvalidTimeFormat = &syslogparser.ParserError{"Invalid time format"} ErrInvalidAppName = &syslogparser.ParserError{"Invalid app name"} ErrInvalidProcId = &syslogparser.ParserError{"Invalid proc ID"} ErrInvalidMsgId = &syslogparser.ParserError{"Invalid msg ID"} ErrNoStructuredData = &syslogparser.ParserError{"No structured data"} )
Functions ¶
This section is empty.
Types ¶
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func NewParser ¶
Example ¶
package main import ( "fmt" "gitee.com/menciis/go-syslog/internal/syslogparser/rfc5424" ) func main() { b := `<165>1 2003-10-11T22:14:15.003Z mymachine.example.com evntslog - ID47 [exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"] An application event log entry...` buff := []byte(b) p := rfc5424.NewParser(buff) err := p.Parse() if err != nil { panic(err) } fmt.Println(p.Dump()) }
Output:
func (*Parser) Dump ¶
func (p *Parser) Dump() syslogparser.LogParts
Click to show internal directories.
Click to hide internal directories.