Hi,
Is it possible to rename field containing .index suffix to different name?
Like IF-MIB::ifAdminStatus.10 => AdminStatus
First try ( of course not workig" was:
filter { mutate { rename => [ "IF-MIB::ifAdminStatus.*", "AdminStatus" ] }
}
Thx
Rudolf
You could do that in ruby
ruby { code => ' event.to_hash.each { |k, v| newk = k.gsub(/^IF-MIB::if(.*)\.[0-9]+/, "\\1") if k != newk event.set(newk, v) event.remove(k) end } ' }
BUT... if you have multiple occurrences of an item in a MIB (.1, .2, etc) this will lose all except the last.
It works as I expected
© 2020. All Rights Reserved - Elasticsearch
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.