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:
This looks promising, but so far no luck. I don't have a name on the array, so I'm not sure how to access it via the event getter. Unfortunately the data is what it is, I can't modify it. The top level element of an event is the array, the elements of the array are the fields themselves. Is there a way for the event object to return the elements of the top-level array without the array itself having a name?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.