I am using a JSON plugin to parse logs in JSON format.
Eventually, the nested variable names are retrieved along with their parent names.
How can I simply get just the variable names?
The first one is to update your grok pattern like this : (?<MY_JSON>\{.*"api_code":"(?<api_code>[0-9]+).*\})
With this syntax, the field MY_JSON don't change and you create a new field named api_code who contain the integer.
The second possibility is to use the rename option with the mutate filter but you have to know in advance the name of each field you need.
The last one is to use the ruby filter to browse the JSON. event['MY_JSON']['results'].each...
With this one, no necessity to know the field name in advance.
I only try the grok pattern so the others possibilities possibly need some update to work.
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.