Created
July 3, 2017 05:33
-
-
Save jclosure/8e103dee2f7e9491845a2c0bb64c6b7a to your computer and use it in GitHub Desktop.
Kibana Painless scripted field checks if field exists or is empty and returns default, otherwise value
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!doc.containsKey('myfield') || doc['myfield'].empty) { return "unavailable" } else { return doc['myfield'].value } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you so much !!!!