Logstash set another offset (00:00) for fields of DateTimeOffset type

Viewed 65

Our Logstash moves data from SQL Server DB to Elastic. But it changes offset of DatetimeOffset values (with 04:30 offset) and sets another offset (00:00). I know finally, values are the same, But why does it change my offset? And how can I prevent this? What changes should I make to the Logstash configuration?

1 Answers

If a column in your database is a date or time then there is code in the jdbc input that converts it to a LogStash::Timestamp. Those are always in UTC.

If that results in the wrong timestamp, you may be able to use the default_timezone option. Alternatively, you could use the serverTimezone option in the SQL connection string as mentioned here.

If you want the input to not do the conversion then CAST it to a non-date/time type in your SELECT.

Related