# Calculate timestamp duration to next document

**URL:** <https://discuss.elastic.co/t/calculate-timestamp-duration-to-next-document/297244>\
**Category:** Logstash\
**Created:** [February 15, 2022, 1:04pm UTC](https://discuss.elastic.co/t/calculate-timestamp-duration-to-next-document/297244 "2022-02-15T13:04:52Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![jannik.b](https://avatars.discourse-cdn.com/v4/letter/j/97f17d/32.png) [@jannik.b](https://discuss.elastic.co/u/jannik.b)\
**Post date:** [February 17, 2022, 11:08am UTC](https://discuss.elastic.co/t/calculate-timestamp-duration-to-next-document/297244/12 "2022-02-17T11:08:00Z")

</div>

so the example result you gave looked good, but i'm not sure what you mean about the implementation. This post somehow does not help me much: [https://discuss.elastic.co/t/concatenating-array-objects-in-elasticsearch-transform-aggregations/289980](https://discuss.elastic.co/t/concatenating-array-objects-in-elasticsearch-transform-aggregations/289980)

I have tested only this without success:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/4/44e0cbf7879e150f2c12923b7b50cb8da5bce9a7.png)

---

_[View the full topic](https://discuss.elastic.co/t/calculate-timestamp-duration-to-next-document/297244)._
