# Logstash Date filter timezone

**URL:** <https://discuss.elastic.co/t/logstash-date-filter-timezone/143461>\
**Category:** Logstash\
**Created:** [August 8, 2018, 9:14am UTC](https://discuss.elastic.co/t/logstash-date-filter-timezone/143461 "2018-08-08T09:14:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shubhank\_Gupta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shubhank_gupta/32/25038_2.png) [@Shubhank\_Gupta](https://discuss.elastic.co/u/Shubhank_Gupta)\
**Post date:** [August 8, 2018, 9:14am UTC](https://discuss.elastic.co/t/logstash-date-filter-timezone/143461/1 "2018-08-08T09:14:48Z")

</div>

Hi,

filebeat.yml

Code -

filebeat.inputs:

- type: log  
paths:

This is my code as filter .conf file

date {  
match =\> ["log\_timestamp" , "yyyyMMdd HHmmss.SSSSSS"]  
target =\> "@timestamp"  
#timezone =\> "%{[fields][timeZone]}"  
#timezone =\> "%{[field][timeZone]}"  
#add\_field =\> { "debug" =\> "debugTimestampMatched"}  
add\_field =\> { "timezone\_value" =\> "%{[fields][timeZone]}"}  
}

Now my issue is how to provide timezone value in date filter of timeZone value coming from filebeat.  
timeZone value is either "UTC" or "IST" or "EST" only.

add\_field =\> { "timezone\_value" =\> "%{[fields][timeZone]}"}  
This syntax gives value as

timezone\_value %{[fields][timeZone]}

Thanks,

---

<div class="post-metadata">

**Author:** ![Shubhank\_Gupta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shubhank_gupta/32/25038_2.png) [@Shubhank\_Gupta](https://discuss.elastic.co/u/Shubhank_Gupta)\
**Post date:** [August 8, 2018, 9:23am UTC](https://discuss.elastic.co/t/logstash-date-filter-timezone/143461/2 "2018-08-08T09:23:52Z")

</div>

> [@Shubhank\_Gupta](#):
>
> timezone\_value %{[fields][timeZone]}

I have tried  
add\_field =\> { "timezone\_value" =\> %{[fields][timeZone]}}

Same result

Need help

---

<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:** [August 8, 2018, 12:11pm UTC](https://discuss.elastic.co/t/logstash-date-filter-timezone/143461/3 "2018-08-08T12:11:21Z")

</div>

Since you have `fields_under_root: true` the fields don't end up as subfields of `fields`.

Note that it doesn't appear that the `timezone` option supports all the timezone names that you have. See the documentation of that option.

---

<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:** [September 5, 2018, 12:11pm UTC](https://discuss.elastic.co/t/logstash-date-filter-timezone/143461/4 "2018-09-05T12:11:33Z")

</div>

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