I am trying to parse some new data through Logstash, it comes through as an array of KV pairs
"custom.fields": [
{
"Field_A": "Value A"
},
{
"Field_B": "Value B"
},
{
"Field_C": "Value C"
},
{
"Field_D": "Value D"
},
{
"Field_E": "Value E"
}
]
I want to parse it within the same document so that when I index it to Elasticsearch it comes out as;
"Field_A": "Value A"
"Field_B": "Value B"
etc
We have been looking and I don't think any of the built in Plugins will cover this, and our attempts at Ruby haven't been working;
event.get('[custom][fields]').each do |i|
event.get(i).each {|k,v|
event.set('[custom_fields][' + k + ']', v)
}
end