Trying to do something like a switch case as below : if value < 1 then field = 'low' else if value >= 1 && < 20 then field = 'medium' else if value >= 20 && < 50 then field = 'high' else field = 'veryHigh'
I didn't try it, but I guess there would have to be some more brackets around each step of the way so solve this with a long long long one-liner, but reading that hurts anyway. Would it be horrible to use the long version?
if event.get('value').nil? then
event.set('field', nil)
elsif event.get('value') < 1000000 then
event.set('field', 'Low')
elsif … etc etc etc …
…
end
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.