# From the apache log timestamp have to extract the timezone and store it in elastic Db

**URL:** <https://discuss.elastic.co/t/from-the-apache-log-timestamp-have-to-extract-the-timezone-and-store-it-in-elastic-db/119243>\
**Category:** Logstash\
**Created:** [February 9, 2018, 1:37pm UTC](https://discuss.elastic.co/t/from-the-apache-log-timestamp-have-to-extract-the-timezone-and-store-it-in-elastic-db/119243 "2018-02-09T13:37:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ranganath\_nangineni](https://avatars.discourse-cdn.com/v4/letter/r/3ec8ea/32.png) [@ranganath\_nangineni](https://discuss.elastic.co/u/ranganath_nangineni)\
**Post date:** [February 9, 2018, 1:37pm UTC](https://discuss.elastic.co/t/from-the-apache-log-timestamp-have-to-extract-the-timezone-and-store-it-in-elastic-db/119243/1 "2018-02-09T13:37:01Z")

</div>

Hi,

I have the below logformat , I need to store the timezone of the original timestamp's timezone in characters.

Ex:  
Log format:  
10.68.36.27 - [adam@gmail.com](mailto:adam@gmail.com) [05/Feb/2018:14:52:23 -0600] "GET /content/web/cnt2626024 HTTP/1.1" 200 1543 "[https://mysite.com/index.htm](https://mysite.com/index.htm)" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0" "10.39.197.233" "image/png"

if the timestamp is [05/Feb/2018:14:52:23 -0600], i have to convert the -0600 to the timezone CST and store it as separate timezone field in ES.

if it is -0500 , I need that to be stored as EST.

Any help how to achieve this using grok or anyother filter plugin ?

---

<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:** [February 9, 2018, 2:29pm UTC](https://discuss.elastic.co/t/from-the-apache-log-timestamp-have-to-extract-the-timezone-and-store-it-in-elastic-db/119243/2 "2018-02-09T14:29:39Z")

</div>

Presumably you already have a grok filter that extracts the timestamp to a field (the you feed to a date filter). You can add another grok filter that parses the timestamp string and extracts the timezone into a yet another field, which you then feed to a translate filter that maps the UTC offset into a timezone name.

---

<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:** [March 9, 2018, 2:29pm UTC](https://discuss.elastic.co/t/from-the-apache-log-timestamp-have-to-extract-the-timezone-and-store-it-in-elastic-db/119243/3 "2018-03-09T14:29:49Z")

</div>

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