Logstash - how to flat json array with ruby filter?

You can take a look at my ruby code, perhaps it will help you understand yours. Or you can just use the filter.