Field reference in ruby filter


(Róbert Kovács) #1

Is it possible to reference a field inside the ruby filters code?
I have a field with an ID and I would like to create a variable for each of it's values if it has not been created yet, or do something with it, if I already created it.
Something like this:
ruby {
code =>
"if defined? $my_var%{my_ID} == nil
$my_var%{my_ID} = 0;
else
do stuff with $my_var%{my_ID}
end"
}


(Magnus Bäck) #2

https://www.elastic.co/guide/en/logstash/current/event-api.html


(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.