Remove Time Zone from Logstash output


(Ritesh) #1

I am trying following to remove the 'Z' from logstash output but its not working

Do we have any working solution here

In my source the date format is is yyyy-MM-dd HH:mm:ss.SSS

the Actual output i am getting from logstash is yyyy-MM-ddTHH:mm:ss.SSSZ

Expected result is yyyy-MM-ddTHH:mm:ss.SSS or yyyy-MM-ddTHH:mm:ss.SSS-08:00

I am trying this below filter, but no luck

date {
  match => [ "eventdate" , "yyyy-MM-ddTHH:mm:ss.SSS-08:00" ]
  timezone => "UTC"
}

Please help out here


(Magnus Bäck) #2

What output(s) are you using?


(Ritesh) #3

Hi @magnusbaeck

I am using http output a REST API and my input is jdbc

Thanks!


(Magnus Bäck) #4

Okay. I think the REST endpoint should be capable of parsing just about any ISO8601 timestamp, but maybe it's not under your control. You'll have to use a ruby filter to format the timestamp value in the format you prefer and save it in a field that you can reference in your http output. I'm afraid I don't have any example code for this.


(Ritesh) #5

I am okay if we can get this yyyy-MM-ddTHH:mm:ss.SSS in text/string format also.

Not necessarily to have in date format

can we use some grok or gsub.?

Is there any way to convert date to a text and then use gsub?

I tried those but i have never used these plugin, so not getting any output


(system) #6

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