# Timestamp format

**URL:** <https://discuss.elastic.co/t/timestamp-format/344951>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [October 12, 2023, 9:52pm UTC](https://discuss.elastic.co/t/timestamp-format/344951 "2023-10-12T21:52:50Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![hta](https://avatars.discourse-cdn.com/v4/letter/h/a8b319/32.png) [@hta](https://discuss.elastic.co/u/hta)\
**Post date:** [October 12, 2023, 9:52pm UTC](https://discuss.elastic.co/t/timestamp-format/344951/1 "2023-10-12T21:52:51Z")

</div>

We get the timestamps in this format: '2023-10-01T01:22:33.123Z'.  
Where can I set the format? And which time zone is preset? How can I find out the timezone from the timestamp? Is that UTC?

We use filebeat agents to collect the logs.

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [October 12, 2023, 10:58pm UTC](https://discuss.elastic.co/t/timestamp-format/344951/2 "2023-10-12T22:58:10Z")

</div>

> [@hta](#):
>
> 2023-10-01T01:22:33.123Z

This is in UTC, the Z in the end means that the time is in UTC.

Since Elasticsearch store all date and times in UTC, you do not need to change this date.

---

<div class="post-metadata">

**Author:** ![hta](https://avatars.discourse-cdn.com/v4/letter/h/a8b319/32.png) [@hta](https://discuss.elastic.co/u/hta)\
**Post date:** [October 12, 2023, 11:07pm UTC](https://discuss.elastic.co/t/timestamp-format/344951/3 "2023-10-12T23:07:23Z")

</div>

thanks for the reply. How do I recognize the time zone? If my application were to run in a different time zone than mine, it would be important to me in which time zone the log entry was written

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [October 12, 2023, 11:48pm UTC](https://discuss.elastic.co/t/timestamp-format/344951/4 "2023-10-12T23:48:19Z")

</div>

> [@hta](#):
>
> How do I recognize the time zone? If my application were to run in a different time zone than mine, it would be important to me in which time zone the log entry was written

This depends entirely on how the application is logging the date and time.

Filebeat will collect the log lines and send them to elasticsearch, if you want the date and time present in your log line to be used as the date and time for the elasticsearch document, you will need to parse your log line and set this field as the `@timestamp` field.

---

<div class="post-metadata">

**Author:** ![hta](https://avatars.discourse-cdn.com/v4/letter/h/a8b319/32.png) [@hta](https://discuss.elastic.co/u/hta)\
**Post date:** [October 13, 2023, 9:44am UTC](https://discuss.elastic.co/t/timestamp-format/344951/5 "2023-10-13T09:44:51Z")

</div>

Thank you for the detailed answer @ [leandrojmp](https://discuss.elastic.co/u/leandrojmp) .  
Can you or someone else tell me how to identify the time zone? In which time zone was the log created? I can't tell from the timestamp. Can you change the time zone? E.g. :02:00 or +2?

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [October 13, 2023, 12:09pm UTC](https://discuss.elastic.co/t/timestamp-format/344951/6 "2023-10-13T12:09:28Z")

</div>

> [@hta](#):
>
> Can you or someone else tell me how to identify the time zone? In which time zone was the log created?

But identify where? It is not clear what is your issue.

A date string that has timezone information will normally have it at the end with something like "+0200" or "+02:00", if you do not have anything like this then you cannot know in which timezone the log is just by looking at the log line.

---

<div class="post-metadata">

**Author:** ![hta](https://avatars.discourse-cdn.com/v4/letter/h/a8b319/32.png) [@hta](https://discuss.elastic.co/u/hta)\
**Post date:** [October 13, 2023, 8:11pm UTC](https://discuss.elastic.co/t/timestamp-format/344951/7 "2023-10-13T20:11:15Z")

</div>

So we get log entries from Filebeat where there is a timestamp field. For example, it contains this value "2023-10-01T01:22:33.123Z"  
How can I configure filebeat so that it should also write the time zone? Or can I configure it somewhere else?

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [October 13, 2023, 9:37pm UTC](https://discuss.elastic.co/t/timestamp-format/344951/8 "2023-10-13T21:37:11Z")

</div>

> [@hta](#):
>
> So we get log entries from Filebeat where there is a timestamp field. For example, it contains this value "2023-10-01T01:22:33.123Z"

I'm sorry, but what log are you talking about?

The log files that filebeat will read or the log files that filebeat generate, as the log for the filebeat service?

The times in the logs generated by the filebeat service are in UTC, I do not think you can change it.

The times in the logs that filebeat reads are created by your application, those logs will be sent to Elasticsearch, is in Elasticsearch that you are seeing this time? It is not clear what your issue really is.

Times in Elasticsearch are also in UTC and you cannot change that, the times in UTC will be converted by Kibana to the browser time zone.

---

<div class="post-metadata">

**Author:** ![hta](https://avatars.discourse-cdn.com/v4/letter/h/a8b319/32.png) [@hta](https://discuss.elastic.co/u/hta)\
**Post date:** [October 16, 2023, 12:58pm UTC](https://discuss.elastic.co/t/timestamp-format/344951/9 "2023-10-16T12:58:08Z")

</div>

Thank you for your answer and please excuse the confusion.  
The logs generated by filebeat have a timestamp field. I now understand that this timestamp is in UTC. But in which time zone? Unfortunately I don't understand that. The Filebeat agents could run in different time zones and in the end it is important for me to know in which time zone the filebeat entry was created.

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [October 16, 2023, 1:02pm UTC](https://discuss.elastic.co/t/timestamp-format/344951/10 "2023-10-16T13:02:47Z")

</div>

> [@hta](#):
>
> The logs generated by filebeat have a timestamp field. I now understand that this timestamp is in UTC. But in which time zone?

The logs generated by the filebeat service are in UTC, there is no timezone offset in UTC time, it is the equivalent of GMT.

Timezones are time offsets from UTC/GMT, for example, a timezone of +0300, means that the time is 3 hours ahead of UTC/GMT.

---

<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:** [November 13, 2023, 3:03pm UTC](https://discuss.elastic.co/t/timestamp-format/344951/11 "2023-11-13T15:03:17Z")

</div>

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