# Use time same with the host local timezone

**URL:** <https://discuss.elastic.co/t/use-time-same-with-the-host-local-timezone/139197>\
**Category:** Logstash\
**Created:** [July 9, 2018, 2:30pm UTC](https://discuss.elastic.co/t/use-time-same-with-the-host-local-timezone/139197 "2018-07-09T14:30:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![poper](https://avatars.discourse-cdn.com/v4/letter/p/3e96dc/32.png) [@poper](https://discuss.elastic.co/u/poper)\
**Post date:** [July 9, 2018, 2:30pm UTC](https://discuss.elastic.co/t/use-time-same-with-the-host-local-timezone/139197/1 "2018-07-09T14:30:52Z")

</div>

Hi There,

I have read more topics but I don't understand about timezone. So I just need to create the file with the hour in the day. output e.g. 21.log, 22.log, 23.log, 00.log, 01.log

My logstash.conf

file {  
path =\>"/var/log/%{+HH}.log"  
}

But when I use HH it returns 18 looks in my test log below not same my local timezone. I need to use same a local timezone in my host. how can I fix it?

{"@version":"1","host":"x.x.x.x","@timestamp":"2018-07-09T14:18:31.923Zport":57541,"message":"{"@message": "python test message", "@tags": ["hon", "test"]}"}

My local timezone is Time zone: Asia/Bangkok (+07, +0700)

Thank you.

---

<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 9, 2018, 6:14pm UTC](https://discuss.elastic.co/t/use-time-same-with-the-host-local-timezone/139197/2 "2018-07-09T18:14:27Z")

</div>

You'd have to use a ruby filter to translate the `@timestamp` into local time, grab the hour from that time and store it in a field.

---

<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:** [August 6, 2018, 6:19pm UTC](https://discuss.elastic.co/t/use-time-same-with-the-host-local-timezone/139197/3 "2018-08-06T18:19:16Z")

</div>

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