Skip to content
This repository was archived by the owner on Feb 22, 2021. It is now read-only.

Commit cecaea9

Browse files
kklopfensteinsystemizer
authored andcommitted
- use aws timestamp if ecsLogsEvent time is not found #34 (#35)
1 parent 5bec34d commit cecaea9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/event.go

+4
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ func NewEvent(cwEvent cloudwatchlogs.FilteredLogEvent, group string) Event {
3535
var ecsLogsEvent ecslogs.Event
3636
if err := json.Unmarshal([]byte(*cwEvent.Message), &ecsLogsEvent); err != nil {
3737
ecsLogsEvent = ecslogs.MakeEvent(ecslogs.INFO, *cwEvent.Message)
38+
}
39+
40+
// If time was not found use AWS Timestamp
41+
if ecsLogsEvent.Time.IsZero() {
3842
ecsLogsEvent.Time = ParseAWSTimestamp(cwEvent.Timestamp)
3943
}
4044

0 commit comments

Comments
 (0)