Cherry-pick #10801 to 7.0: Beats event processing and default fields#11155
Merged
urso merged 1 commit intoelastic:7.0from Mar 8, 2019
Merged
Cherry-pick #10801 to 7.0: Beats event processing and default fields#11155urso merged 1 commit intoelastic:7.0from
urso merged 1 commit intoelastic:7.0from
Conversation
ph
approved these changes
Mar 8, 2019
Contributor
ph
left a comment
There was a problem hiding this comment.
LGTM, but we have missed a changelog in the original PR.
This changes moves the generation of the event processing into it's distinct package, such that the actual publisher pipeline will not define any processors anymore. A new instance of a publisher pipeline must not add fields on it's own. This change converts the event processing pipline into the 'Supporter' pattern, which is already used for Index Management. As different beats ask for slightly different behavior in the event processing (e.g. normalize, default builtins and so on), the `processing.Support` can be used for customizations. (cherry picked from commit 83dfb2f)
houndci-bot
reviewed
Mar 8, 2019
|
|
||
| // WithBeatMeta adds beat meta information as builtin fields to a processing pipeline. | ||
| // The `key` parameter defines the field to be used. | ||
| func WithBeatMeta(key string) modifier { |
There was a problem hiding this comment.
exported func WithBeatMeta returns unexported type processing.modifier, which can be annoying to use
| } | ||
|
|
||
| // WithECS modifier adds `ecs.version` builtin fields to a processing pipeline. | ||
| var WithECS modifier = WithFields(common.MapStr{ |
There was a problem hiding this comment.
should omit type modifier from declaration of var WithECS; it will be inferred from the right-hand side
| } | ||
|
|
||
| // WithFields creates a modifier with the given default builtin fields. | ||
| func WithFields(fields common.MapStr) modifier { |
There was a problem hiding this comment.
exported func WithFields returns unexported type processing.modifier, which can be annoying to use
ph
approved these changes
Mar 8, 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 #10801 to 7.0 branch. Original message:
This changes moves the generation of the event processing into it's
distinct package, such that the actual publisher pipeline will not
define any processors anymore. A new instance of a publisher pipeline
must not add fields on it's own.
With this change we convert the event processing pipline into the 'Supporter'
pattern, which is already used for Index Management.
As different beats ask for slightly different behavior in the event
processing (e.g. normalize, default builtins and so on), the
processing.Supportercan be used for customizations.Also fixes new fields accidentily being added to the monitoring outputs, as it separates the pipeline and processors.
Simplifies tests, but also adds a few test cases for dynamic fields and other settings.