Skip to content

Commit

Permalink
[Functionbeat] fix cloudwatch logs timestamp to use logRecord timesta…
Browse files Browse the repository at this point in the history
…mp… (#13291)

… instead of record processing timestamp

The suggested TODO code passes the Cloudwatch timestamp as seconds. The Cloudwatch field value is milliseconds. Pass it as nanoseconds times 1000000.

Closes: #12412
  • Loading branch information
sbasgall authored and kvch committed Aug 27, 2019
1 parent f28055f commit d9a85ad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
*Functionbeat*

- Fix function name reference for Kinesis streams in CloudFormation templates {pull}11646[11646]
- Fix Cloudwatch logs timestamp to use timestamp of the log record instead of when the record was processed {pull}13291[13291]

==== Added

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func CloudwatchLogs(request events.CloudwatchLogsData) []beat.Event {

for idx, logEvent := range request.LogEvents {
events[idx] = beat.Event{
Timestamp: time.Now(), // TODO: time.Unix(logEvent.Timestamp, 0),
Timestamp: time.Unix(0, logEvent.Timestamp*1000000),
Fields: common.MapStr{
"message": logEvent.Message,
"id": logEvent.ID,
Expand Down

0 comments on commit d9a85ad

Please sign in to comment.