Wrong rounding up of sum in kibana


(Benyamin Dvoskin) #1

Hi,

we've noticed that in some cases kibana is rounding up the sum for numbers we aggregate in a wrong way (or perhpas we just don't know how to configure it right...)

please see the 3 screenshots for amount.
the 3 numbers (actual data sent in the original json) are the following:
8.99
11.99
7.99

in the discovery tab, they are each rounded up to 9, 12 and 8.
this should sum to 29.

but when we create a table visualization, the sum displayed is 26 (which is correct when rounding down).

any idea what's going on?

thanks,
Benjamin





(Jim Unger) #2

Can you post the mapping for that field?

docs
curl -XGET 'http://localhost:9200/logstash-*/_mapping/apache/field/@tags' would return the mapping for the @tags field in the apache type of the logstash-* indices (with my ES endpoint being at localhost:9200)


(Benyamin Dvoskin) #3

it's mapped as 'long'.


(Jim Unger) #4

According to the docs the long type is an integer. So if I'm not mistaken, when the field is being summed by ES, it is being done so as integer values. You need to index these values as doubles.


(system) #5