Rename variable field in json file using logstash

Hi,

I have a jason file which has event0,event1, event2......event50000. I would like to rename all of it to event in Logstash so that the field name is event and corresponding value of event0, event 1 are stored under event field.

I understand that there is no wild card which works in Logstash and ruby filter is one that we can use. Need help to write ruby code to rename it.

Hello.
Please work a bit harder on the question formulation and give proper input and expected output.
I can only guess that you want to produce from:

{"event1":"value1", "event2":"value2"}

the structure:

{"event":{"event1":"value1", "event2":"value2"}}
?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.