Skip to content

Releases: mprcela/go-syslog

2.2.2: Add support for timestamp in RFC3339 format (#47)

13 Jun 08:17
Compare
Choose a tag to compare
Default Go log/syslog is sending syslog messages in that format:
https://github.com/golang/go/blob/9745eed4fd4160cfbf55e9dbbfa99aca5563b392/src/log/syslog/syslog.go#L294

That is not according to the standard:
"The TIMESTAMP field is the local time and is in the format of "Mmm dd hh:mm:ss" (without the quote marks)"
(https://tools.ietf.org/html/rfc3164#section-5.3)

But it is necessery if we want to parse lines sent by log/syslog.

One small fix, time.Stamp is same as those two formats:
-               "Jan 02 15:04:05",
-               "Jan  2 15:04:05",
+               time.Stamp,