parser: fallback zone-less source timestamps to Europe/Moscow
This commit is contained in:
3
internal/parser/vendors/inspur/sel.go
vendored
3
internal/parser/vendors/inspur/sel.go
vendored
@@ -6,6 +6,7 @@ import (
|
||||
"time"
|
||||
|
||||
"git.mchus.pro/mchus/logpile/internal/models"
|
||||
"git.mchus.pro/mchus/logpile/internal/parser"
|
||||
)
|
||||
|
||||
// ParseSELList parses selelist.csv file with SEL events
|
||||
@@ -81,7 +82,7 @@ func parseSELTimestamp(dateStr, timeStr string) time.Time {
|
||||
timestampStr := dateStr + " " + timeStr
|
||||
|
||||
// Try parsing with MM/DD/YYYY format
|
||||
t, err := time.Parse("01/02/2006 15:04:05", timestampStr)
|
||||
t, err := parser.ParseInDefaultArchiveLocation("01/02/2006 15:04:05", timestampStr)
|
||||
if err != nil {
|
||||
// Fallback to current time
|
||||
return time.Now()
|
||||
|
||||
Reference in New Issue
Block a user