-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cherry-pick #10801 to 7.0: Beats event processing and default fields #11155
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)
|
||
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported func WithFields returns unexported type processing.modifier, which can be annoying to use
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.Supporter
can 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.