# Logstash timezone is not work

**URL:** <https://discuss.elastic.co/t/logstash-timezone-is-not-work/365466>\
**Category:** Logstash\
**Tags:** elastic-stack-alerting\
**Created:** [August 23, 2024, 2:40pm UTC](https://discuss.elastic.co/t/logstash-timezone-is-not-work/365466 "2024-08-23T14:40:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Magali\_Romero](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magali_romero/32/137022_2.png) [@Magali\_Romero](https://discuss.elastic.co/u/Magali_Romero)\
**Post date:** [August 23, 2024, 2:40pm UTC](https://discuss.elastic.co/t/logstash-timezone-is-not-work/365466/1 "2024-08-23T14:40:54Z")

</div>

Hi,

I have this configuration in logstash.conf, however the alerts continue to arrive in UTC

```auto
  filter {
if "his-vm" in [tags] {
# Agregar campos debug_alert_id y formatted_timestamp
mutate {
add_field => { "debug_alert_id" => "%{[alert_id]}" }
add_field => { "formatted_timestamp" => "%{@timestamp}" }
}

# Ajustar la zona horaria de formatted_timestamp
date {
match => ["formatted_timestamp", "ISO8601"]
timezone => "America/Asuncion"
target => "formatted_timestamp"
}
}
}

```

Help please!

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [August 23, 2024, 2:50pm UTC](https://discuss.elastic.co/t/logstash-timezone-is-not-work/365466/2 "2024-08-23T14:50:46Z")

</div>

> [@Magali\_Romero](#):
>
> the alerts continue to arrive in UTC

The output of a date filter is _always_ UTC. The timezone option to a date filter tells the filter what timezone the input is in. But if the input field looks like "2024-08-23T14:38:10.928Z" then that Z at the end means the string is in UTC so the timezone option is ignored.

Depending on what you want to achieve it may be helpful to [remove the Z](https://discuss.elastic.co/t/convert-timezone-of-timestamp-field/212703/6) before calling the date filter. In other use cases you may need to [use ruby](https://discuss.elastic.co/t/convert-datetime-to-another-timezone-in-logstash/336214/9).

---

<div class="post-metadata">

**Author:** ![Magali\_Romero](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magali_romero/32/137022_2.png) [@Magali\_Romero](https://discuss.elastic.co/u/Magali_Romero)\
**Post date:** [August 23, 2024, 3:26pm UTC](https://discuss.elastic.co/t/logstash-timezone-is-not-work/365466/3 "2024-08-23T15:26:09Z")

</div>

Thanks! It works
