I'm desperately trying to use the scripted fields feature of Kibana in order to apply a minor transform on a display value. Based on everything I've read in the scripted fields guide and scripts in aggregation guide, I should be able to do something as simple as the following:
if (doc['field_name'].value > 0) { (ceil(doc['field_name'].value) / 1000) / 60 }
But when I do that, I end up with an error on every page that says "Discover: An error occurred with your request. Reset your inputs and try again."
Furthermore, if I simply transform the value:
(ceil(doc['field_name'].value) / 1000) / 60
Everything works great, except when I run a query which contains elements that don't have the doc['field_name'] in question...hence my attempt at an "if" statement.
Does anyone have a good resource for scripting these fields, or see anything wrong with my logic?