# Get timezone for the log event arriving in logstash

**URL:** <https://discuss.elastic.co/t/get-timezone-for-the-log-event-arriving-in-logstash/25624>\
**Category:** Logstash\
**Created:** [July 15, 2015, 12:52pm UTC](https://discuss.elastic.co/t/get-timezone-for-the-log-event-arriving-in-logstash/25624 "2015-07-15T12:52:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DK\_3](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dk_3/32/48003_2.png) [@DK\_3](https://discuss.elastic.co/u/DK_3)\
**Post date:** [July 15, 2015, 12:52pm UTC](https://discuss.elastic.co/t/get-timezone-for-the-log-event-arriving-in-logstash/25624/1 "2015-07-15T12:52:46Z")

</div>

I'm using the date filter to create the `@timestamp` field based on a `log_timestamp` field  
`"log_timestamp", "%{year}-%{month}-%{day} %{time},%{ms}"`

```
date {
    match => ["log_timestamp", "YYYY-MM-dd HH:mm:ss,SSS"]
    timezone => "<Log events timezone here>"
}

```

How can I get the log event's timezone in order to pass this to the date filter?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [July 15, 2015, 1:40pm UTC](https://discuss.elastic.co/t/get-timezone-for-the-log-event-arriving-in-logstash/25624/2 "2015-07-15T13:40:29Z")

</div>

This is best set at the source. Unfortunately I recall that the `timezone` parameter doesn't support `%{varname}` expansions, i.e. you can't store the timezone in a `timezone` field and say `timezone => "%{timezone}`. This has maybe changed in Logstash 1.5.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 5:34am UTC](https://discuss.elastic.co/t/get-timezone-for-the-log-event-arriving-in-logstash/25624/3 "2017-07-06T05:34:38Z")

</div>


