I have some numeric fields in elasticsearch, I have to implement some logic for which I need to create some scripted fields. I am new to kibana 4's scripted fields feature, so I need some help regarding a basic format that could be used for writing a basic if else condition in scripted fields. Detailed explanation: I have a number field x in elasticsearch, I need to create two scripted fields f1 and f2 such that,
f1 = 1 and f2 = 0
f1 = 0 and f2 = 1
Just need the correct syntax to do this in Kibana 4's scripted fields feature. Also tell if this can't be done.
For more information on scripted fields refer : https://www.elastic.co/guide/en/kibana/current/settings.html