my event data like this...
"thread" => "Thread-74-__system-executor[-1 -1]", "message" => "2017-06-19 16:46:12.750 o.a.s.d.executor Thread-74-__system-executor[-1 -1] [INFO] Prepared bolt __system:(-1)", "type" => "o.a.s.d.executor", "content" => "Prepared bolt __system:(-1)", "timestamp" => "2017-06-19 16:46:12.750"
i want to put [timestamp, content, type, thread] replace the old message key & change the value type to a Hash
we found the best way is
mutate { add_field => { "[data][timestamp]" => "%{timestamp}" "[data][thread]" => "%{thread}" } remove_field => "message" # rename => {"data" => "message"} #this will fail!!! }
mutate { rename => {"data" => "message"} }
this is so dirty....
data => {"thread" => "%{thread}", "timestamp" => "%{timestamp}"} will produce a array not a Hash...
so what's the best practice??? should we need to use ruby to convert a array to a Hash???