Hi All
How to add/rename fields recursively, instead doing one by one
Here is my dataset with message value as
[{
"Row ID" : 201,
"Order ID" : "CA-2017-105074",
"Order Date" : "6/24/2017",
"Segment" : "Consumer",
..
..
..
..
}, {
"Row ID" : 454,
"Order ID" : "CA-2017-147277",
"Segment" : "Test",
..
..
..
..} ]
I am using this in conf file
split { field => "[message]" }
mutate {
add_field => {"Row ID" => "%{[message][Row ID]}"}
add_field => {"Order ID" => "%{[message][Order ID]}"}
add_field => {"Segment" => "%{[message][Segment]}"}
}
With this filter, i get right result
In my dataset i have close to 200 columns,
its very difficult to define the column name for each and every mutate for each field
How we can do this recursively using Ruby? To define all the names for each field in one go
Thanks