How to convert a Date field from CET timezone to UTC and save in elasticsearch using logstash


#1

I want to convert date from CET i.e. 2014-11-12T13:52:11.000Z
I want output as UTC: 2014-11-12T11:52:11.000Z
How can I achieve thus?
Thanks!


(Mark Walkom) #2

The date filter is what you want! :slight_smile:
https://www.elastic.co/guide/en/logstash/5.1/plugins-filters-date.html


(Mark Walkom) #4

What does your data look like then, after the grok?


#5

Thanks for reply but I have already tried that, as below:
date {
match => [ "validationStopTime" , "yyyy-MM-dd'T'HH:mm:ss.SSSZ" ]
target => "validationStopTime"
timezone => "Europe/Athens"
}

But I'm getting a exception: cannot convert instance of class org.jruby.RubyObject to class java.lang.String


#6

This the final output I store in elasticSearch right now : "2015-11-17T05:55:14.000Z"


(system) #7

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