Arithmetic Operations in logstash


#1

Hi Team,

How to perform arithmetic Operations in logstash
Example: (((field1)+((($field2)-(field1))/2))/300)

Thanks,
Dinesh


#2

There is a math filter that you could install. Otherwise you have to use a ruby filter.

ruby { code => 'event.set("someField", event.get("field1") + event.get("field2"))' }