Hi Logstash Team.
I'd like to load data struct as below.
INPUT:
{
"vmdata":{
"vm1": "UP",
"vm2": "Down",
"vm3": "UP"
.....
}
}
OUTPUT:
event: vm1: "UP"
event: vm2: "Down"
....
event: ...
Anybody can help? very appreciate!
Hi Logstash Team.
I'd like to load data struct as below.
INPUT:
{
"vmdata":{
"vm1": "UP",
"vm2": "Down",
"vm3": "UP"
.....
}
}
OUTPUT:
event: vm1: "UP"
event: vm2: "Down"
....
event: ...
Anybody can help? very appreciate!
Finally I am able to do it by ruby filter.
ruby{
init => "require 'json'"
code => "
event.get('[data][hostlist]').to_hash.each do |k,v|
newevent = event.clone
newevent.set('vm', k)
newevent.set('status' , v)
newevent.remove('vmdata')
new_event_block.call(newevent)
end
"
}
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 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.