I am aggregating a numeric field which contains the response time data. When i try to find the avg value it is giving me a very long number(>10 digitis after the decimal point). Could you please help in rounding that value to have two decimal places.
I have tried script with Math.round() function but it is not working. Could you please help me with the query.
I have tried:
"aggs": {
"avg_rtime": {
"avg": {
"script": "Math.round(doc['rt.time'].value*100)/100.0"
}
}
}
I am using this query to send an email alert using watcher in kibana. I am sending the average values in the email text. So i want to round them to show only two decimal places or one or to a nearest integer.
If there is any chance in rounding the values in the email text body also useful for me.
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.