# How rollup jobs memorize last processed document?

**URL:** <https://discuss.elastic.co/t/how-rollup-jobs-memorize-last-processed-document/204595>\
**Category:** Kibana\
**Created:** [October 22, 2019, 7:30am UTC](https://discuss.elastic.co/t/how-rollup-jobs-memorize-last-processed-document/204595 "2019-10-22T07:30:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![isharamadhawa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/isharamadhawa/32/68006_2.png) [@isharamadhawa](https://discuss.elastic.co/u/isharamadhawa)\
**Post date:** [October 22, 2019, 7:30am UTC](https://discuss.elastic.co/t/how-rollup-jobs-memorize-last-processed-document/204595/1 "2019-10-22T07:30:22Z")

</div>

I went through my rollup job `JSON` file and I think `current_position` in below config is the way how a rollup job memorizes the last document it processed.

```
"status": {
    "job_state": "started",
    "current_position": {
      "@timestamp.date_histogram": 1571728849000,
      "status.terms": "complete"
    }

```

My question is what if I insert data which have `@timestamp` value less than `@timestamp.date_histogram` (last processed timestamp value)

Will they also be processed?

Or `@timestamp` values which are greater than last processed timestamp value will only be processed?

---

<div class="post-metadata">

**Author:** ![bhavyarm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhavyarm/32/22392_2.png) [@bhavyarm](https://discuss.elastic.co/u/bhavyarm)\
**Post date:** [October 22, 2019, 10:19pm UTC](https://discuss.elastic.co/t/how-rollup-jobs-memorize-last-processed-document/204595/2 "2019-10-22T22:19:04Z")

</div>

@alisongoryachev can you please help here?

Thanks,  
Bhavya

---

<div class="post-metadata">

**Author:** ![alisongoryachev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alisongoryachev/32/111352_2.png) [@alisongoryachev](https://discuss.elastic.co/u/alisongoryachev)\
**Post date:** [October 24, 2019, 5:06pm UTC](https://discuss.elastic.co/t/how-rollup-jobs-memorize-last-processed-document/204595/3 "2019-10-24T17:06:01Z")

</div>

Hi @isharamadhawa! The timestamp is important. It's used as the [`after_key`](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-composite-aggregation.html). If you add, change or delete data before that timestamp it won't be rolled up again.

To compensate for ingest delay, you can use the `delay` parameter. See the [Create rollup job](https://www.elastic.co/guide/en/kibana/current/data-rollups.html#_create_the_rollup_job) example and the [Rollup job configuration](https://www.elastic.co/guide/en/elasticsearch/reference/current/rollup-job-config.html#rollup-job-config) documentation for more details.

---

<div class="post-metadata">

**Author:** ![isharamadhawa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/isharamadhawa/32/68006_2.png) [@isharamadhawa](https://discuss.elastic.co/u/isharamadhawa)\
**Post date:** [October 24, 2019, 5:10pm UTC](https://discuss.elastic.co/t/how-rollup-jobs-memorize-last-processed-document/204595/4 "2019-10-24T17:10:04Z")

</div>

Hi @alisongoryachev, Thank you for your answer 🙂

---

<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 21, 2019, 5:10pm UTC](https://discuss.elastic.co/t/how-rollup-jobs-memorize-last-processed-document/204595/5 "2019-11-21T17:10:10Z")

</div>

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