logstash-plugins / logstash-filter-date

Apache License 2.0
7 stars 43 forks source link

wrong timezone #157

Open 88107251 opened 1 year ago

88107251 commented 1 year ago

Logstash information:

  1. Logstash version: 8.8.1
  2. Logstash installation source: expanded from tar archive
  3. Logstash being run Via command line
  4. Logstash using the bundled JDK

Description of the problem including expected versus actual behavior: I want to parse date-time records with logstash date filter. My records have Asia/Tehran time zone. After the recent changes in the time zone in Iran and the removal of DST from it, apparently my date of records does not parse correctly. For example, June 10, 2021 at 12:00 Tehran time should be 7:30 UTC, and June 10, 2023 at 12:00 Tehran time should be 8:30 UTC, but both are 7:30 UTC.

My logstash version is 8.8.1 and I tested it with versions 8.8.0 and 7.14.0 and the result was the same.

sample code: echo "10 June 2021 12:00:00.000" | bin/logstash -e "filter { date { match => ['message', 'dd MMMM YYYY HH:mm:ss.SSS'] target => timeid timezone => 'Asia/Tehran' } }" result: "timeid" => 2021-06-10T07:30:00.000Z echo "10 June 2023 12:00:00.000" | bin/logstash -e "filter { date { match => ['message', 'dd MMMM YYYY HH:mm:ss.SSS'] target => timeid timezone => 'Asia/Tehran' } }" result: "timeid" => 2023-06-10T07:30:00.000Z correct result: "timeid" => 2023-06-10T08:30:00.000Z

link of issue in elastic forum: https://discuss.elastic.co/t/logstash-date-timezone/336803

tnx