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