Skip to content

Cherry-pick #17026 to 7.x: Fix _id field in s3 and googlepubsub inputs#17117

Merged
andrewkroh merged 2 commits intoelastic:7.xfrom
andrewkroh:backport_17026_7.x
Mar 19, 2020
Merged

Cherry-pick #17026 to 7.x: Fix _id field in s3 and googlepubsub inputs#17117
andrewkroh merged 2 commits intoelastic:7.xfrom
andrewkroh:backport_17026_7.x

Conversation

@andrewkroh
Copy link
Copy Markdown
Member

@andrewkroh andrewkroh commented Mar 19, 2020

Cherry-pick of PR #17026 to 7.x branch. Original message:

What does this PR do?

In #15859 the Elasticsearch output was changed to read from the @metadata._id field when it had been using @metadata.id. The s3 and googlepubsub inputs had both been setting @metadata.id, but were not updated with that change.

This updates the s3 and googlepubsub inputs to use beat.Event#SetID() rather than creating the metadata object themselves.

Why is it important?

These inputs rely on the Elasticsearch _id field to prevent duplicate events from being written to Elasticsearch in certain edge cases.

Related issues

In elastic#15859 the Elasticsearch output was changed to read from the @metadata._id field when it had been using @metadata.id.
The s3 and googlepubsub inputs had both been setting @metadata.id, but were not updated with that change.

This updates the s3 and googlepubsub inputs to use `beat.Event#SetID()` rather than creating the metadata object themselves.

(cherry picked from commit 304eca4)
@andrewkroh andrewkroh merged commit a89a5cd into elastic:7.x Mar 19, 2020
@andrewkroh andrewkroh deleted the backport_17026_7.x branch January 14, 2022 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants