# Inclusion of ingest timestamp in elasticsearch index

**URL:** <https://discuss.elastic.co/t/inclusion-of-ingest-timestamp-in-elasticsearch-index/122740>\
**Category:** Elasticsearch\
**Created:** [March 6, 2018, 3:51pm UTC](https://discuss.elastic.co/t/inclusion-of-ingest-timestamp-in-elasticsearch-index/122740 "2018-03-06T15:51:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pratheek](https://avatars.discourse-cdn.com/v4/letter/p/a698b9/32.png) [@Pratheek](https://discuss.elastic.co/u/Pratheek)\
**Post date:** [March 6, 2018, 3:51pm UTC](https://discuss.elastic.co/t/inclusion-of-ingest-timestamp-in-elasticsearch-index/122740/1 "2018-03-06T15:51:15Z")

</div>

I have come across ,including ingest timestamp value of a record to an ES index,but not clear on that.Can anyone help me out on adding the ingest timestamp to the index.

Regards,  
Pratheek

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 6, 2018, 3:57pm UTC](https://discuss.elastic.co/t/inclusion-of-ingest-timestamp-in-elasticsearch-index/122740/2 "2018-03-06T15:57:08Z")

</div>

If you need to add the current date to a document at index time, you have 2 choices:

- Do that on your side. Just add the date in the document before sending it to elasticsearch
- Use an [ingest node script processor](https://www.elastic.co/guide/en/elasticsearch/reference/6.2/script-processor.html) to compute that date on elasticsearch side. Note that this one will be slower than doing that on your side.

---

<div class="post-metadata">

**Author:** ![Pratheek](https://avatars.discourse-cdn.com/v4/letter/p/a698b9/32.png) [@Pratheek](https://discuss.elastic.co/u/Pratheek)\
**Post date:** [March 6, 2018, 4:20pm UTC](https://discuss.elastic.co/t/inclusion-of-ingest-timestamp-in-elasticsearch-index/122740/3 "2018-03-06T16:20:09Z")

</div>

Thanks David,

In case of option 1 ,I need to generate a field having present timestamp and index it right,but won't there be any difference between the original and indexed time (incase of any latency in indexing).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 6, 2018, 4:31pm UTC](https://discuss.elastic.co/t/inclusion-of-ingest-timestamp-in-elasticsearch-index/122740/4 "2018-03-06T16:31:06Z")

</div>

Yeah. The network latency will add some delay I guess.

---

<div class="post-metadata">

**Author:** ![Pratheek](https://avatars.discourse-cdn.com/v4/letter/p/a698b9/32.png) [@Pratheek](https://discuss.elastic.co/u/Pratheek)\
**Post date:** [March 7, 2018, 4:17pm UTC](https://discuss.elastic.co/t/inclusion-of-ingest-timestamp-in-elasticsearch-index/122740/5 "2018-03-07T16:17:05Z")

</div>

Thanks again!!! ,the ingest node processor worked out well for me.

---

<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, 4:17pm UTC](https://discuss.elastic.co/t/inclusion-of-ingest-timestamp-in-elasticsearch-index/122740/6 "2018-04-04T16:17:12Z")

</div>

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