# How to set @timestamp with my timezone?

**URL:** https://discuss.elastic.co/t/how-to-set-timestamp-with-my-timezone/82457
**Category:** Logstash
**Created:** [April 15, 2017, 1:19am UTC](https://discuss.elastic.co/t/how-to-set-timestamp-with-my-timezone/82457 "2017-04-15T01:19:09Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Bazum](https://avatars.discourse-cdn.com/v4/letter/b/958977/32.png) [@Bazum](https://discuss.elastic.co/u/Bazum)
#### Post date: [April 15, 2017, 1:19am UTC](https://discuss.elastic.co/t/how-to-set-timestamp-with-my-timezone/82457/1 "2017-04-15T01:19:09Z")

</div>

Hi,

Hey guys I woud like to know if it is possible to change the @timezone from logstash to my timezone (Brazil/East).  
I need to change the timezone because I am using the -%{+YYYY-MM-dd} to create index with its processing date.  
I have already tryed:

```
 date {
	   add_field => { "timestamp" => "@timestamp" }
       match => ["timestamp" , "dd/MMM/yyyy:HH:mm:ss Z"]
       timezone => "Brazil/East"
       target => "@timestamp"	   
    }

```

and

```
ruby {
        code => "event.set('@timestamp','event.get("@timestamp").localtime("-03:00")')"
    }

```

But it does not work.

I am using Filebeat, Logstash and Kibana version 5.2.2

---

<div class="post-metadata">

### Author: ![eperry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eperry/32/551_2.png) [@eperry](https://discuss.elastic.co/u/eperry)
#### Post date: [April 15, 2017, 1:14pm UTC](https://discuss.elastic.co/t/how-to-set-timestamp-with-my-timezone/82457/2 "2017-04-15T13:14:13Z")

</div>

Yah I thought this way a while back, that it was annoying that the indexes rotate at GMT, but then realized all of my queries have date ranges in them and the index timestamp does not matter.

well all the date is stored as an Integer, the TZ and stuff is just meta data. But I think you want to be focusing on the log-stash elasticsearch output as this uses the GMT by default. As that is setting the new "Index" time and it I guess is defaulted as GMT not based on the @timestamp meta info of TZ

[https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html#plugins-outputs-elasticsearch-index](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html#plugins-outputs-elasticsearch-index)

That link says it uses the Joda Time format which I am guessing if you tweak your output statement it will correct your time rotation.

[http://www.joda.org/joda-time/apidocs/org/joda/time/format/DateTimeFormat.html](http://www.joda.org/joda-time/apidocs/org/joda/time/format/DateTimeFormat.html)

I never thought about it, but be interested in your results

---

<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 18, 2017, 5:39am UTC](https://discuss.elastic.co/t/how-to-set-timestamp-with-my-timezone/82457/3 "2017-04-18T05:39:50Z")

</div>

The `@timestamp` field is by definition UTC. Elasticsearch, Kibana, and other tools assume this and you'll run into various odd behaviors if you mess with this. Please don't.

---

<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 16, 2017, 5:45am UTC](https://discuss.elastic.co/t/how-to-set-timestamp-with-my-timezone/82457/4 "2017-05-16T05:45:12Z")

</div>

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