-
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
Parameterizing Painless script literals #9770
Parameterizing Painless script literals #9770
Conversation
jenkins, test this |
@ycombinator Thanks for starting to tackle this. I also made some notes about this here: #9777 (see the comments below). To have much nicer PR's we should probably take on #5339 again. This would make things nicer. |
jenkins test this |
CI failure does not seem to be related. Need to check if this sneaked into master in an other PR as it complains about traefik and ingesting data into an alias. |
Rebasing on master should get CI green for this one. |
5e431e0
to
eac4f37
Compare
@ruflin CI is green now. When you get a chance, could you review please? |
"lang": "painless", | ||
"source": "if (ctx.redis.log.role == params.master_abbrev) {\n ctx.redis.log.role = params.master;\n } else if (ctx.redis.log.role == params.slave_abbrev) {\n ctx.redis.log.role = params.slave;\n } else if (ctx.redis.log.role == params.child_abbrev) {\n ctx.redis.log.role = params.child;\n } else if (ctx.redis.log.role == params.sentinel_abbrev) {\n ctx.redis.log.role = params.sentinel;\n }\n ", | ||
"params": { | ||
"master_abbrev": "M", |
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.
It seems odd that we have to extract all these constants which are only used once but I don't think there is a better way. Perhaps @jakelandis can comment?
I created a meta issue here to track this: #9821 |
@ruflin Made the changes you requested. Ready for your 👀 again, when you get a chance. Thanks! |
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.
As nothing changed in the golden files, I think we are good. Tricky to review TBH.
jenkins, test this |
1 similar comment
jenkins, test this |
) * Parameterizing Painless script literals (#9770) * Parameterizing some script literals * Fixing script property name * Fixing syntax error * Reverting nginx change * Reverting auditd pipeline change (for now) * Work around painless limitation * Working around Painless issue for nginx module ingest pipeline * Parameterizing one more script in redis module ingest pipeline * Adding back lang field to explicitly set script language to Painless * Reformatting nginx access log * Fixing indent (cherry picked from commit 2c6030d) * Fixing up redis pipeline for 6.x * Fixing up nginx pipeline for 6.x
Several Filebeat CI runs are failing like so:
For example:
This PR tries to parameterize any painless scripts in Filebeat modules' pipelines to see if it helps with the
Too many dynamic script compilations within, max: [75/5m]
error. Specifically, it parameterizes literals that were previous used in painless scripts by the following Filebeat module pipelines:auditd
nginx
redis