# How 'old' are the documents?

**URL:** https://discuss.elastic.co/t/how-old-are-the-documents/250766
**Category:** Kibana
**Created:** [October 2, 2020, 9:02am UTC](https://discuss.elastic.co/t/how-old-are-the-documents/250766 "2020-10-02T09:02:47Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Artur\_Trindade](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/artur_trindade/32/45618_2.png) [@Artur\_Trindade](https://discuss.elastic.co/u/Artur_Trindade)
#### Post date: [October 2, 2020, 9:02am UTC](https://discuss.elastic.co/t/how-old-are-the-documents/250766/1 "2020-10-02T09:02:47Z")

</div>

Hello,

I have need to create a plot that shows how long the documents exists in the index  
My first idea would be creating a scripted field that computes something like `now()-timestamp`  
How can this be performed in kibana?

---

<div class="post-metadata">

### Author: ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)
#### Post date: [October 5, 2020, 4:57pm UTC](https://discuss.elastic.co/t/how-old-are-the-documents/250766/2 "2020-10-05T16:57:12Z")

</div>

Yes, your intuition is good.  
This is how to calculate the difference between 2 dates in Kibana scripted fields: [Kibana, getting todays date](https://discuss.elastic.co/t/kibana-getting-todays-date/85766/7)

There will be small differences in seconds based on how many documents the calculation is done for, but I guess you don't need that kind of precision.

---

<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 2, 2020, 4:57pm UTC](https://discuss.elastic.co/t/how-old-are-the-documents/250766/3 "2020-11-02T16:57:17Z")

</div>

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