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

Always add conditionals to all processor actions #2068

Merged
merged 4 commits into from
Jul 21, 2016

Conversation

urso
Copy link

@urso urso commented Jul 19, 2016

processor registry automatically adds conditional support to registered actions
by wrapping processor constructors with NewConditional.

With this PR every processor action being registered automatically gains support for the when-conditional clause without having to any any extra code. This simplifies existing processor actions code, by requiring actions to implement only the required actions instead of check, parsing, applying conditional configurations. Plus it ensures conditionals always work exactly the same for all available actions.

@urso urso added in progress Pull request is currently in progress. review libbeat :Processors labels Jul 19, 2016
@urso urso force-pushed the always-conditionals branch from a087dbf to 0029b71 Compare July 19, 2016 21:59
return event, nil
}

func (f includeFields) Run(event common.MapStr) (common.MapStr, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume the reference * was removed intentionally.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, includeFields is basically []string.

@ruflin
Copy link
Contributor

ruflin commented Jul 20, 2016

Nice addition.

processor registry automatically adds conditional support to registered actions
by wrapping processor constructors with NewConditional.
@urso urso force-pushed the always-conditionals branch from 0029b71 to 32cba95 Compare July 20, 2016 12:26
@urso urso removed the in progress Pull request is currently in progress. label Jul 20, 2016
@urso urso mentioned this pull request Jul 20, 2016
@monicasarbu monicasarbu merged commit 805114f into elastic:master Jul 21, 2016
@urso urso deleted the always-conditionals branch February 19, 2019 18:29
@cmacknz cmacknz mentioned this pull request Nov 22, 2022
4 tasks
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