# I want to save index by my own time zone

**URL:** https://discuss.elastic.co/t/i-want-to-save-index-by-my-own-time-zone/127918
**Category:** Logstash
**Created:** [April 13, 2018, 7:30am UTC](https://discuss.elastic.co/t/i-want-to-save-index-by-my-own-time-zone/127918 "2018-04-13T07:30:07Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![chenzilong444](https://avatars.discourse-cdn.com/v4/letter/c/bbe5ce/32.png) [@chenzilong444](https://discuss.elastic.co/u/chenzilong444)
#### Post date: [April 13, 2018, 7:30am UTC](https://discuss.elastic.co/t/i-want-to-save-index-by-my-own-time-zone/127918/1 "2018-04-13T07:30:08Z")

</div>

```
output {
		elasticsearch { 
						hosts => localhost	  	
						index => "logstash(%{+yyyy.MM.dd})"  
						document_type =>"logstash"
		}   
		stdout {  
            codec => rubydebug
        }
}

```

index =\> "logstash(%{+yyyy.MM.dd})" now it use @timestamp and it is utc time  
i don't want to change @timestamp ,i want to save index by my own time zone

---

<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: [April 13, 2018, 7:46am UTC](https://discuss.elastic.co/t/i-want-to-save-index-by-my-own-time-zone/127918/2 "2018-04-13T07:46:15Z")

</div>

The `%{+yyyy.MM.dd}` notation always uses UTC. You can use a ruby filter to store whatever date format you want in a `@metadata` field and reference that instead. This has been discussed many times before so please search the archives.

---

<div class="post-metadata">

### Author: ![chenzilong444](https://avatars.discourse-cdn.com/v4/letter/c/bbe5ce/32.png) [@chenzilong444](https://discuss.elastic.co/u/chenzilong444)
#### Post date: [April 13, 2018, 7:59am UTC](https://discuss.elastic.co/t/i-want-to-save-index-by-my-own-time-zone/127918/3 "2018-04-13T07:59:07Z")

</div>

thank you thank you~

---

<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: [May 11, 2018, 7:59am UTC](https://discuss.elastic.co/t/i-want-to-save-index-by-my-own-time-zone/127918/4 "2018-05-11T07:59:31Z")

</div>

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