# Logstash convert field to local time

**URL:** https://discuss.elastic.co/t/logstash-convert-field-to-local-time/124645
**Category:** Logstash
**Created:** [March 19, 2018, 9:26pm UTC](https://discuss.elastic.co/t/logstash-convert-field-to-local-time/124645 "2018-03-19T21:26:33Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![motts](https://avatars.discourse-cdn.com/v4/letter/m/839c29/32.png) [@motts](https://discuss.elastic.co/u/motts)
#### Post date: [March 19, 2018, 9:26pm UTC](https://discuss.elastic.co/t/logstash-convert-field-to-local-time/124645/1 "2018-03-19T21:26:33Z")

</div>

Hello there,

I am working with some IIS logs, but they are exporting the date as UTC only. Is there a way to logstash that so that it takes UTC time and converts that to the local server time? I know there is an @timestamp that displays the time the event was processed, but if for some reason LogStash hangs and needs to be restarted or there is latency, that time for the log will be off.

The log displays the date field like this:

`March 19th 2018, 15:53:27.341`

Thank you much

---

<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: [March 19, 2018, 9:33pm UTC](https://discuss.elastic.co/t/logstash-convert-field-to-local-time/124645/2 "2018-03-19T21:33:16Z")

</div>

Normally one uses the date filter to parse a timestamp string and store it in UTC in ISO8601 format in the `@timestamp` field. If you insist on storing it in local time (which I don't recommend; UTC is a good thing and conversion to local time should be done by presentation layers) you need to write some Ruby code in a ruby filter. Examples have been posted in the past.

---

<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: [April 16, 2018, 9:39pm UTC](https://discuss.elastic.co/t/logstash-convert-field-to-local-time/124645/3 "2018-04-16T21:39:21Z")

</div>

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