Version: 2.3.4
Operating System: CentOS
i want to change @timestamp format from 2016-10-09T11:08:57.636Z to 2016-10-09T11:08:57.636+0800
i found two ways using filter to solve this problem
1.
filter {
ruby { code => "event['@timestamp']=event['@timestamp'].localtime('-05:00')" }
}
the result:
Ruby exception occurred: undefined method `localtime' for "2016-10-09T11:17:31.760Z":LogStash::Timestamp {:level=>:error}
filter {
ruby { code => "event['@timestamp']=event['@timestamp'].time.localtime('-05:00')" }
}
the result:
"@timestamp":"2016-10-09T06:25:56.681-05:00","tags":["_rubyexception"]
adding a new tag with error,and the timezone has became -05:00 not 0500.
what can i do if i want to change the timezone from -05:00 to -0500 in @timestamp?