influxdata / go-syslog

Blazing fast syslog parser
MIT License
477 stars 69 forks source link

Can rfc3164 (BSD syslog) parser support custom timestamp format? #36

Open KiVirgil opened 4 years ago

KiVirgil commented 4 years ago

rfc3164 parser can parse log like logStr = "<134>Jul 16 02:15:13 an 200050021 id=OS time="2020-7-16 02:15:13" timezone=GMT(+0000)", but can't parse log like logStr = "<134>Jul 16 2020 02:15:13 an 200050021 id=OS time="2020-7-16 02:15:13" timezone=GMT(+0000)". It will cause error: expecting a Stamp timestamp [col 14].

russorat commented 4 years ago

I don't see an example of that type of log parsing in the test cases file. Would you be willing to add a test case and open a pr?