# Change time zone of output to ES index

**URL:** https://discuss.elastic.co/t/change-time-zone-of-output-to-es-index/86048
**Category:** Logstash
**Created:** [May 17, 2017, 6:25am UTC](https://discuss.elastic.co/t/change-time-zone-of-output-to-es-index/86048 "2017-05-17T06:25:26Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![manthan\_patel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manthan_patel/32/48208_2.png) [@manthan\_patel](https://discuss.elastic.co/u/manthan_patel)
#### Post date: [May 17, 2017, 6:25am UTC](https://discuss.elastic.co/t/change-time-zone-of-output-to-es-index/86048/1 "2017-05-17T06:25:26Z")

</div>

Hi,

I am outputting to Elasticsearch with date specific indices. My server time zone is in IST but problem I am facing is my Elasticsearch index changes as per UTC time zone.

How can i change timezone or ES index creation time as per IST

Please find my output which I have writter.

> output {  
> if [componentId] in [0,10] {  
> file {  
> path =\> "/home/manthanb/logstash\_output.txt"  
> }  
> }else{  
> elasticsearch {  
> hosts =\> ["10.10.3.44:9200"]  
> index =\> "logstash-%{componentId}-%{+YYYY.MM.dd}"  
> }  
> }  
> }

---

<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: [May 18, 2017, 5:37am UTC](https://discuss.elastic.co/t/change-time-zone-of-output-to-es-index/86048/2 "2017-05-18T05:37:15Z")

</div>

You'd have to get the date in local time into another field that you can reference in the `index` option's value. None of the stock filters do this so you'l have to resort to a ruby filter.

People are frequently asking about this and I don't understand why the exact time of index rollover matters.

---

<div class="post-metadata">

### Author: ![manthan\_patel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manthan_patel/32/48208_2.png) [@manthan\_patel](https://discuss.elastic.co/u/manthan_patel)
#### Post date: [May 18, 2017, 5:47am UTC](https://discuss.elastic.co/t/change-time-zone-of-output-to-es-index/86048/3 "2017-05-18T05:47:46Z")

</div>

I want exact time of roll over as i have some cleanup system based on index time.

---

<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: [June 15, 2017, 5:48am UTC](https://discuss.elastic.co/t/change-time-zone-of-output-to-es-index/86048/4 "2017-06-15T05:48:28Z")

</div>

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