# TImezone in Elasticsearch logs

**URL:** https://discuss.elastic.co/t/timezone-in-elasticsearch-logs/313540
**Category:** Elasticsearch
**Created:** [September 2, 2022, 10:27am UTC](https://discuss.elastic.co/t/timezone-in-elasticsearch-logs/313540 "2022-09-02T10:27:08Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![cheshirecat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cheshirecat/32/109532_2.png) [@cheshirecat](https://discuss.elastic.co/u/cheshirecat)
#### Post date: [September 2, 2022, 10:27am UTC](https://discuss.elastic.co/t/timezone-in-elasticsearch-logs/313540/1 "2022-09-02T10:27:08Z")

</div>

Hello There!  
I see that my logs for Elasticsearch have different timezone that my server.  
For my server I have got set timezone:  
 ![obraz](https://us1.discourse-cdn.com/elastic/original/3X/9/d/9d265edc4e3be6c8ec0cd0e1facda8c547918a5b.png)  
'pią' is shortcut for 'piątek' that means 'Friday' in Polish.  
My logs however got UTC timezone:

```auto
September 2, 2022 10:15:25 AM
	
INFO
	
Server
	
successfully reloaded changed geoip database file [/tmp/elasticsearch-12446836234446054485/geoip-databases/CVsfpe93TZqMenYYAvjJvA/GeoLite2-City.mmdb]
	
o.e.i.g.DatabaseNodeService
	
node-1
September 2, 2022 10:15:19 AM
	
INFO
	
Server
	
successfully reloaded changed geoip database file [/tmp/elasticsearch-12446836234446054485/geoip-databases/CVsfpe93TZqMenYYAvjJvA/GeoLite2-Country.mmdb]
	
o.e.i.g.DatabaseNodeService
	
node-1

```

Print screen:

 ![obraz](https://us1.discourse-cdn.com/elastic/original/3X/f/2/f2d2640d056858018f773c8d88fc7c38765572d1.png)  
What can I do to have same timezone for all settings, logs and indicies in my cluster?

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [September 6, 2022, 1:10am UTC](https://discuss.elastic.co/t/timezone-in-elasticsearch-logs/313540/2 "2022-09-06T01:10:17Z")

</div>

Elasticsearch assumes that the timestamp that you are passing to it is in UTC, and has a TZ in there as needed.

I guess it comes down to how you process your events, and if you are taking this into account.

---

<div class="post-metadata">

### Author: ![cheshirecat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cheshirecat/32/109532_2.png) [@cheshirecat](https://discuss.elastic.co/u/cheshirecat)
#### Post date: [September 6, 2022, 6:55am UTC](https://discuss.elastic.co/t/timezone-in-elasticsearch-logs/313540/3 "2022-09-06T06:55:39Z")

</div>

Thank you @warkolm for a reply.  
Am I able to change timestamp to my timezone? I can't find it in docs but I have found this [post](https://discuss.elastic.co/t/how-to-set-timestamp-timezone/28401/10). It is seven years old so I don't know will it still work.

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [September 6, 2022, 7:56am UTC](https://discuss.elastic.co/t/timezone-in-elasticsearch-logs/313540/4 "2022-09-06T07:56:17Z")

</div>

How are you ingesting data?

---

<div class="post-metadata">

### Author: ![cheshirecat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cheshirecat/32/109532_2.png) [@cheshirecat](https://discuss.elastic.co/u/cheshirecat)
#### Post date: [September 6, 2022, 8:08am UTC](https://discuss.elastic.co/t/timezone-in-elasticsearch-logs/313540/5 "2022-09-06T08:08:38Z")

</div>

I hope this is an answer for your question - my `logstash.conf` file looks like this:

```auto
input {
  beats {
    port => {{port_number_1}}
    ssl_key => '/etc/logstash/es.key.pem'
    ssl_certificate => '/etc/logstash/es.crt.pem'
    ssl => true
    host => "{{ip_address}}"
  }
}

output {
  elasticsearch {
    ssl_certificate_verification => false
    cacert => '/etc/logstash/elastic-stack-ca.crt'
    password => "{{pass}}"
    user => "elastic"
    hosts => ["https://{{ip_address}}:{{port_number_2}}" ,"https://{{ip_address}}:{{port_number_2}}" ,"https://{{ip_address}}:{{port_number_2}}"]
    index => "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"
  }
}

```

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [September 6, 2022, 8:46am UTC](https://discuss.elastic.co/t/timezone-in-elasticsearch-logs/313540/6 "2022-09-06T08:46:57Z")

</div>

What Beat(s)? And how are they configured?

They should be pretty smart in picking up the system TZ and adjusting, but it pays to check.

---

<div class="post-metadata">

### Author: ![cheshirecat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cheshirecat/32/109532_2.png) [@cheshirecat](https://discuss.elastic.co/u/cheshirecat)
#### Post date: [September 6, 2022, 8:49am UTC](https://discuss.elastic.co/t/timezone-in-elasticsearch-logs/313540/7 "2022-09-06T08:49:00Z")

</div>

Beats that I use are:

- metricbeat
- filebeat
- auditbeat
- heartbeat

---

<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: [October 4, 2022, 8:49am UTC](https://discuss.elastic.co/t/timezone-in-elasticsearch-logs/313540/8 "2022-10-04T08:49:23Z")

</div>

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