if "el5" in [message] {
ruby {
init => "@@linuxversion='5'"
code => "
event.set('linux',@@linuxversion)
puts linux <--- this line is the issue
"
}
drop {}
}
Also, why are you using a drop just after the ruby filter? It will discard the event althogether.
I need to set the variable value on the basis of this line and then use in further cases. Nd also i dont want to parse this line as this is of none use except that.
If you set a field value with event.set('fieldname') you can retrieve it with event.get('fieldname').
I need to set the variable value on the basis of this line and then use in further cases.
You mean future events? Then you can't use event.set(). That sets a field in the current event which isn't carried over to other events. Setting a variable like @@linuxversion might work though.
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.