Define format/type of specific number fields

Hi here,

Thanks in advance to take the time to read it and I hope help me out.
I'm using a logstash filter with a ruby code to subtract two fields and create a 3rd one.
Like below :
input { jdbc { db details [...] } }

filter { ruby { code => "
event.set('f3', (event.get('f1').nil? || event.get('f2').nil?) ? nil : event.get('f2')-event.get('f1'))
" } } }

output { elasticsearch { elastic details [...] } } }

It seems to work because I don't get any warning in my logstash log file.
But it doesn't because values for f1 and f2 are sometimes slightly different than the ones in my database for example :
for f1 = 1.362444 / f2 = 1.361873 I've got in Kibana f1=f2=1.362 (so rounded by default 3 digits)
for f1 = 1.1404912 / f2 = 1.1404054 I've got in Kibana f1=f2=1.14 (so rounded by default 2 digits)
but I have also few examples that are working well like :
for f1 = 3262.59 / f2 = 3256.84, I have the same in Kibana

Can someone explain me how elastic works about the default field type picked up and where comes this rounded thing by default from.
I potentially need 7 digits as decimals
Thanks
Guillaume

Sorry,
Just figured out what I am doing wrong here...

Just posting the "solution" here
If you are looking at the values from the "discover" panel you'll see only 2 or 3 digits but if you open a specific row and check the json code, you got all the digits your number has
Sorry for opening this useless topic
Regards

See here for how to change the display from the 3 digit default.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.