The fields and values are being populated with a ruby script from nested JSON. This thread shows all the configs associated. Utilize Data Parsed From Nested JSON
OK, I think I misunderstood. You have a field on the event with a variable field name "Serial Number ( MODEL )" and its value is "RandomSerial"? You want to rename the field to a fixed value and also extract the variable part of the field name as the value of a field called [Model]? That will definitely require ruby.
I don't have time to test this but you could start with something like:
code => '
event.to_hash.each { |k, v|
if k.start_with?("Serial Number (")
event.set("Model", k.gsub("[^(]+\(", "").gsub(")$", ""))
event.set("SerialNumber", v)
end
}
'
Apologies if my ruby code (like the double gsub) makes your eyeballs bleed.
I recommend against using space in field names (hence [SerialNumber] instead of [Serial Number]).
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.