How to read each array item into a map of key value pair?

I would use an approach like this. Find a regexp with two capture groups, one to capture the key, one to capture the value, use .scan to get an array of arrays, then for each array use event.set to add fields to the event.