I´m trying to do script calculation using the result of a metric and a field in JSON input. I change the elasticsearch.yml configuration to allowed scripting adding:
script.engine.groovy.inline.search: true script.groovy.sandbox.enabled: true script.inline: on script.indexed: on script.search: true script.engine.groovy.inline.aggs: true
_value is the result of a sum in kibana metrics visualization and in the same metric putting:
{
"script": " _value / 9"
}
in the JSON input, kibana gives the correct result. But if the script needs the value of a field like:
{
"script": "_value / doc['some-field'].value "
}
kibana don´t show the correct result or don´t give any result.
By default Kibana defaults to the Lucene expressions scripting language, so you need to include the "lang" : "groovy" parameter in your script. See example here Calling groovy script from Kibana
(∑MISS / ∑HTTP requests – ∑Manifests requests – ∑m3u8 requests) in Δt * 100%
But I don´t know if I can do this kind of formulas in Kibana or Elasticsearch.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.