-
Notifications
You must be signed in to change notification settings - Fork 24.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
add ignore_empty_value parameter in set ingest processor #57030
Conversation
Pinging @elastic/es-core-features (:Core/Features/Ingest) |
@elasticmachine ok to test |
@elasticmachine update branch |
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.
@gaobinlong, this looks great. I left two minor changes below and I'll get it merged if those look good to you.
server/src/main/java/org/elasticsearch/ingest/IngestDocument.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Dan Hermann <danhermann@users.noreply.github.com>
Co-authored-by: Dan Hermann <danhermann@users.noreply.github.com>
@elasticmachine update branch |
@gaobinlong, sorry for the delay on this one. If you can fix the two new compile errors (just add another boolean parameter to the |
@danhermann, I have done that and all checks have passed. |
Thank you, @gaobinlong! I've merged this and will also get it back-ported to the appropriate branches. |
@gaobinlong Just wanted to say thank you for the contribution, I had a issue open on this for a while and it allows me to do some fairly nice changes to pipelines :) |
Relates: elastic/elasticsearch#57030 Co-authored-by: Russ Cam <russ.cam@elastic.co>
Relates: elastic/elasticsearch#57030 Co-authored-by: Russ Cam <russ.cam@elastic.co>
Relates to #54783.
The main point of this PR is adding
ignore_empty_value
in set ingest processr, which can exit quitely if thetemplated value
is null or emtpy string when the parameter is set totrue
.Because the
template value
like{{foo}}
produces empty string when the fieldfoo
does not exist, isnull
orempty string
, so the parameterignore_empty_value
ignores bothnull
orempty string
when it's set totrue
.