So it's basically a mapping from a tag number to its name + get rid of the tags I don't need
I end up so far with the below ruby code (my input line within ["message"]) :
ruby {
code => '
message_tag_value = event.get("message")
tags_values = message_tag_value.split("|")
tags_values.each do |tag_value|
tag, value = tag_value.split("=")
case tag
when 1
event.set("meaning_tag1", value)
when 3
event.set("meaning_tag3", value)
when 5
event.set("meaning_tag5", value)
end
end
' }
I'm not getting any error but the result isn't the one expecting (split seems to fail)
Hope I'm not so far from the correct code
Quick last question, if I want another datatype than String. My only solution is to add into my mutate filter a convert ? There is no other way either within kv filter or renaming/converting in one time ?
Asking this because I only found out recently that this is possible with grok filter using %{BASE10NUM:my-num:int}
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.