Hi,
I have a metric that only makes sense as an absolute number.
How can I turn a -5 to 5 using json input?
Note that this doesn't work, I need the number to be positive when I get a 5 or a -5
{
"script": "_value * -1 "
}
Thanks !
Hi,
I have a metric that only makes sense as an absolute number.
How can I turn a -5 to 5 using json input?
Note that this doesn't work, I need the number to be positive when I get a 5 or a -5
{
"script": "_value * -1 "
}
Thanks !
You could create a scripted field with Math.abs(doc['_value'].value)
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 2020. All Rights Reserved - 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.