Skip to content
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

Merged
merged 1 commit into from
Mar 8, 2019

Conversation

urso
Copy link

@urso urso commented Mar 8, 2019

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.

@urso urso requested review from a team as code owners March 8, 2019 15:53
@urso urso removed the request for review from a team March 8, 2019 15:54
Copy link
Contributor

@ph ph left a 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.

@elastic elastic deleted a comment from houndci-bot Mar 8, 2019
@elastic elastic deleted a comment from houndci-bot Mar 8, 2019
@elastic elastic deleted a comment from houndci-bot Mar 8, 2019
@elastic elastic deleted a comment from houndci-bot Mar 8, 2019
@elastic elastic deleted a comment from houndci-bot Mar 8, 2019
@elastic elastic deleted a comment from houndci-bot Mar 8, 2019
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 {

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{

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 {

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

@urso urso merged commit 4756ec1 into elastic:7.0 Mar 8, 2019
@urso urso deleted the backport_10801_7.0 branch May 9, 2019 18:48
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.

3 participants