I want to know how to calculate percentage using the logstash ruby filter.
I have tried this code and it did not work.
code => "event.set('[ratio_match]', (event.get('A')/event.get('B')*100))"
Kindly help me with where I'm going wrong.
Thanks,
Nandha Krishna
moabbas
(Muhammad Abbas (Mo Abbas))
August 3, 2017, 8:09am
2
Try this one
code => 'event.set("[ratio_match]", [event.get("[OUTSTANDING_COUNT]" / event.get("[ITEM_COUNT]") * 100 ] )'
It looks like you're not closing the first event.get() call (i.e. there's a ")" missing before the "/").
system
(system)
Closed
August 31, 2017, 11:34am
7
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.