# Json @timestamp vs date {}

**URL:** <https://discuss.elastic.co/t/json-timestamp-vs-date/277713>\
**Category:** Logstash\
**Created:** [July 3, 2021, 11:41pm UTC](https://discuss.elastic.co/t/json-timestamp-vs-date/277713 "2021-07-03T23:41:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielmotaleite](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmotaleite/32/19796_2.png) [@danielmotaleite](https://discuss.elastic.co/u/danielmotaleite)\
**Post date:** [July 3, 2021, 11:41pm UTC](https://discuss.elastic.co/t/json-timestamp-vs-date/277713/1 "2021-07-03T23:41:10Z")

</div>

From what i see, one should use in logstash the date {} to modify the event date, but setting the @timestamp field to seems to also work, at least when using json {}, @timestamp object seems to set the date correctly.

I have the json (from a nginx-ingress)  
{ "@timestamp": "2021-07-03T23:17:15+00:00", ...}

And after a json {} i get in kibana:  
|@timestamp |2021-07-04 , 00:17:15.000|  
| logstash\_time |2021-07-04 , 00:17:17.000|

The logstash\_time is the date/time of the logstash when processed the event

So this seems to work, is this safe? or i should still use date {} to the @timestamp (if even works using date on the same field as the date target)

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [July 3, 2021, 11:49pm UTC](https://discuss.elastic.co/t/json-timestamp-vs-date/277713/2 "2021-07-03T23:49:36Z")

</div>

The [documentation](https://www.elastic.co/guide/en/logstash/current/plugins-filters-json.html#_description_138) says

> If the parsed data contains a `@timestamp` field, the plugin will try to use it for the events `@timestamp` , and if the parsing fails, the field will be renamed to `_@timestamp` and the event will be tagged with a `_timestampparsefailure` .

So you do not need to use a date filter.

---

<div class="post-metadata">

**Author:** ![danielmotaleite](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmotaleite/32/19796_2.png) [@danielmotaleite](https://discuss.elastic.co/u/danielmotaleite)\
**Post date:** [July 4, 2021, 12:23am UTC](https://discuss.elastic.co/t/json-timestamp-vs-date/277713/3 "2021-07-04T00:23:14Z")

</div>

Thanks, i started using json long ago, i end miss that part of the documentation. Its perfect then, thanks for the confirmation!

---

<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:** [August 1, 2021, 12:23am UTC](https://discuss.elastic.co/t/json-timestamp-vs-date/277713/4 "2021-08-01T00:23:24Z")

</div>

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