Remove regex from ingest pipeline - #14914
Conversation
🚀 Benchmarks reportTo see the full report comment with |
Kavindu-Dodan
left a comment
There was a problem hiding this comment.
Thanks for working on it. Per shown results it's almost ~40% performance increase
| - version: "1.8.2" | ||
| changes: | ||
| - description: Remove regex from ingest pipeline | ||
| type: bugfix |
There was a problem hiding this comment.
should it be an enhancement and 1.9.0?
There was a problem hiding this comment.
Personally I dont have a strong preference as this is an improvement of previous main change. I will let Kaiyan decide on this
There was a problem hiding this comment.
I debated on this too... But I think this is more of a bugfix on the 1.8.0 version instead of a new feature. Thats why I kept it a bugfix
| // AWS CloudFront Logs | ||
| if (tokenCount==33 && ctx.message =~ /^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}\s[a-zA-Z0-9-]+\s\d+\s(\d+\.\d+\.\d+\.\d+|[a-fA-F0-9:]+)/) { | ||
| ctx.event.dataset = 'aws.cloudfront_logs'; | ||
| // AWS ELB Logs - Updated logic to handle multiple log types |
…eline/default.yml Co-authored-by: Andrew Gizas <andreas.gkizas@elastic.co>
💚 Build Succeeded
History
|
|
|
Package awsfirehose - 1.8.2 containing this change is available at https://epr.elastic.co/package/awsfirehose/1.8.2/ |




Proposed commit message
This PR removed all regex usage in the
awsfirehoseingest pipeline. The script now uses standard Painless string methods (.contains(), .split(), .length(), etc.) to identify log types in order to lower the risk of high CPU consumption.Checklist
changelog.ymlfile.How to test this PR locally
Benchmark results
Both results are ran 4 times and calculated an average with command:
With the change in this PR
Without the change in this PR