Kibana cannot understand, because the read_time field is a string, not a timestamp! You can use ruby filter to do what you need. Just copy @timestamp into the new read_time field, and the field time is in timestamp , not a line. add_field adds a new field with a string type !
Here is my configuration:
input { stdin{} } filter { ruby { code => "event['read_time'] = event['@timestamp']" } mutate { add_field => ["read_time_string", "%{@timestamp}"] } } output { stdout { codec => "rubydebug" } }
You can try and see the output, at the output:
{ "message" => "3243242", "@version" => "1", "@timestamp" => "2014-08-08T01:09:49.647Z", "host" => "BENLIM", "read_time" => "2014-08-08T01:09:49.647Z", "read_time_string" => "2014-08-08 01:09:49 UTC" }
Hope this helps you.
source share