Hi -
Each record of input to my Logstash instance is a JSON array of key-value pairs. I need to translate this array to a single object with the value of the "key" as the field name and the value of the "value" as the field value. For example, this is a single record of input:
[
{"Name":"FirstName","Value":"Jamie"},
{"Name":"LastName","Value":"Smith"},
{"Name":"Email","Value":"test@value.com"},
{"Name":"State","Value":"MO"}
]
And this is the ElasticSearch mapping to which this record needs to fit:
{
"data-test": {
"mappings": {
"_doc": {
"properties": {
"FirstName": { "type": "text" },
"LastName": { "type": "text" },
"Email": { "type": "text" },
"State": { "type": "text" }
}
}
}
}
}
I've been looking at a series of filters (kv, translate, split, etc.) but have not seen an easy way to make this happen reliably.
Any guidance or wisdom would be greatly appreciated!
Thanks -
Brad