parser: fallback zone-less source timestamps to Europe/Moscow
This commit is contained in:
2
internal/parser/vendors/xigmanas/parser.go
vendored
2
internal/parser/vendors/xigmanas/parser.go
vendored
@@ -431,7 +431,7 @@ func parseEventTimestamp(line string) time.Time {
|
||||
prefixRe := regexp.MustCompile(`^[A-Z][a-z]{2}\s+\d{1,2}\s+\d{2}:\d{2}:\d{2}`)
|
||||
if prefix := prefixRe.FindString(line); prefix != "" {
|
||||
year := time.Now().Year()
|
||||
if ts, err := time.Parse("Jan 2 15:04:05 2006", prefix+" "+strconv.Itoa(year)); err == nil {
|
||||
if ts, err := parser.ParseInDefaultArchiveLocation("Jan 2 15:04:05 2006", prefix+" "+strconv.Itoa(year)); err == nil {
|
||||
return ts
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user