Hi,
Using Kibana UI, I created a new script field named "cpu_util_percnt". Value of this field will be calculated based on the following expression:
doc['metric_value_number'].value*100.00
Here, "metric value number" is an existing field with long data type.
In the "Discover" tab, I could find the new field "cpu_util_percnt" and then selected it for performing a search. When I validated the search results, I noticed the following things as shown in the below table:
metric_value_number cpu_util_percnt
1020 102000
0.12 0
2345 234500
0.230 0
Here, we could find that the whole number multiplication works correctly and provides expected result. For example, 1020 * 100 = 1020000. But, the decimal multiplication yields wrong results, i.e., 0.12* 100 should results 12. But, it yields 0.
Kindly check and tell me how to correct the above things to achieve the expected result.