-
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
Make it possible to chain Beat processors in the script processor #11680
Make it possible to chain Beat processors in the script processor #11680
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.
@andrewkroh LGTM, do you want to add support for the new truncate and copy field in another PR?
"DecodeJSONFields": actions.NewDecodeJSONFields, | ||
"Dissect": dissect.NewProcessor, | ||
"DNS": dns.New, | ||
"Rename": actions.NewRenameFields, | ||
} |
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.
We might want to add theses #11297 ?
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.
Yes, I'll add them and expose their constructors. I'm not really happy about having this list but until I come up with a better way to reuse the existing processor registry this works.
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.
Constructors for copy_fields and truncate_fields are now exposed.
Prior to this change it was possible to construct individual Beat processors. This adds the ability to chain them together in a list so that calling a single `Run(event)` function executes the list of processors. var localeProcessor = new processor.AddLocale(); var chain = new processor.Chain() .Add(localeProcessor) .Rename({ fields: [ {from: "event.timezone", to: "timezone"}, ], }) .Add(function(evt) { evt.Put("hello", "world"); }) .Build(); function process(evt) { return chain.Run(evt); }
2297f93
to
06cdb0b
Compare
Prior to this change it was possible to construct individual Beat processors. This adds the ability
to chain them together in a list so that calling a single
Run(event)
function executes the list ofprocessors.