Cherry-pick #14407 to 7.x: Libbeat: Do not overwrite agent.*, ecs.version, and host.name#14879
Merged
cwurm merged 1 commit intoelastic:7.xfrom Dec 5, 2019
Merged
Cherry-pick #14407 to 7.x: Libbeat: Do not overwrite agent.*, ecs.version, and host.name#14879cwurm merged 1 commit intoelastic:7.xfrom
cwurm merged 1 commit intoelastic:7.xfrom
Conversation
kvch
approved these changes
Dec 4, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-pick of PR #14407 to 7.x branch. Original message:
Addresses part of #13920 (comment).
Libbeat currently sets a few fields in every event, with no option to turn it off, or to at least not overwrite existing values.
This is a problem when receiving forwarded events (see #13920 for details). The field I'm most concerned about is
host.namewhich is used by the Kibana SIEM app to identify hosts. This PR changes Libbeat to not overwritehost.nameand a few other fields when they are already set (see list of fields below). This is technically a breaking change, though I think in almost all cases the current behavior is not what users would expect, and it is creating problems in the wild (eg #13706, discuss #1, discuss #2) - so I would like to make it in 7.x.A bit more detail on the implementation: Adds a new function
MapStr. DeepUpdateNoOverwritealongside the existingMapStr.DeepUpdateand anoverwriteparameter to theadd_fieldsprocessor (but does not expose it).The affected fields that will no longer be overwritten if they already exist are:
If we do not want to change the behavior for all these fields we could also refactor the code to only not overwrite
host.name- but I think it makes sense to not overwrite any of these fields.