Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 528974d

Browse files
committed
fix: Fix time format for older versions of journalctl
It was supposed to be already supported, but there was a bug that it was only working in UTC (so the timestamp had to have the `+0000` suffix), and didn't work with e.g. `+0200`.
1 parent 29fb78b commit 528974d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

core/parsing_time.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func DetectTimeLayout(logLine string) string {
140140
var knownFormats = []string{
141141
"Jan _2 15:04:05", // Traditional rsyslog format without year
142142
"2006-01-02T15:04:05.000000Z07:00", // ISO8601, used in modern rsyslog by default
143-
"2006-01-02T15:04:05.000000+0000", // Used by journalctl with --output=short-iso-precise
143+
"2006-01-02T15:04:05.000000-0700", // Used by older versions of journalctl with --output=short-iso-precise
144144
"2006-01-02 15:04:05",
145145
"2006-01-02T15:04:05Z07:00",
146146
"2006-01-02T15:04:05.000Z07:00",

0 commit comments

Comments
 (0)