I'm using Amazon SQS input plugin to get bounced & delivery reports from Amazon SES (Simple Email Service).
One of the fields (mail.headers) is an array of keys and values, like the following:
{
"name": "Message-ID",
"value": "<08c903bee6de5daa173f5856a@swift.generated>"
},
{
"name": "Date",
"value": "Sat, 24 Jun 2017 22:53:33 +0200"
},
{
"name": "Subject",
"value": "Welcome to our website"
},
{
"name": "From",
"value": "Example <info@example.com>"
},
{
"name": "To",
"value": "email@someone.com"
}
I want to split those fields to be something like
headers.Message-ID: <08c903bee6de5daa173f5856a@swift.generated>
headers.Date: Sat, 24 Jun 2017 22:53:33 +0200
headers.Subject: Welcome to our website
...
I have tried doing the following, but unfortunately, it didn't work as expected and returned only one array ignored the rest:
split {
add_field => { "headers[%{[mail][headers][name]}]" => "%{[mail][headers][value]}" }
field => "[mail][headers]"
}
So, how can I achieve this?