# How to get document insert date from Elastic search

**URL:** <https://discuss.elastic.co/t/how-to-get-document-insert-date-from-elastic-search/122935>\
**Category:** Elasticsearch\
**Created:** [March 7, 2018, 5:45pm UTC](https://discuss.elastic.co/t/how-to-get-document-insert-date-from-elastic-search/122935 "2018-03-07T17:45:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![oraclept](https://avatars.discourse-cdn.com/v4/letter/o/ce73a5/32.png) [@oraclept](https://discuss.elastic.co/u/oraclept)\
**Post date:** [March 7, 2018, 5:45pm UTC](https://discuss.elastic.co/t/how-to-get-document-insert-date-from-elastic-search/122935/1 "2018-03-07T17:45:04Z")

</div>

Hi - I am using logstash to ship messages to ES. Logstash automatically adds @timestamp field. I want to know if there is way to tell elastic search or logstash to have actual insert timestamp on document ? is there a elastic search insert timestamp fields which shows in kibana ?

As such I am only seeing @timestamp field which is added by logstash. I am looking for ES insert timestamp.

logstash -\> 6.1.1  
Elastic Search -\> 6.1

I see \_timestamp was deprecated in ES. how do I instruct logstash to add \_timestamp field.

Finally I want to calculate time difference when logstash has sent the document with when it was inserted in ES.

Thanks,

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [March 7, 2018, 6:39pm UTC](https://discuss.elastic.co/t/how-to-get-document-insert-date-from-elastic-search/122935/2 "2018-03-07T18:39:53Z")

</div>

I provided an example of something very similar in [this blog post](https://www.elastic.co/blog/should-i-use-logstash-or-elasticsearch-ingest-nodes).

---

<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:** [April 4, 2018, 6:40pm UTC](https://discuss.elastic.co/t/how-to-get-document-insert-date-from-elastic-search/122935/3 "2018-04-04T18:40:17Z")

</div>

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