# How create a visualization with the last date of document

**URL:** <https://discuss.elastic.co/t/how-create-a-visualization-with-the-last-date-of-document/299938>\
**Category:** Kibana\
**Tags:** elastic-stack-monitoring, kibana-plugin-development\
**Created:** [March 17, 2022, 10:40am UTC](https://discuss.elastic.co/t/how-create-a-visualization-with-the-last-date-of-document/299938 "2022-03-17T10:40:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Oceans](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_oceans/32/51452_2.png) [@David\_Oceans](https://discuss.elastic.co/u/David_Oceans)\
**Post date:** [March 17, 2022, 10:40am UTC](https://discuss.elastic.co/t/how-create-a-visualization-with-the-last-date-of-document/299938/1 "2022-03-17T10:40:47Z")

</div>

Hi,

I would like create a dashboard / visualization with the timestamp of even better with the days from the first document in my indexes, like that

Option A)  
First document found  
13-03-2022 10:00

Option B)  
Retention Days for that index  
7 days

I achieve the query to get the first document, like that

```auto
POST my_index-*/_search
{
   "size": 1,
   "sort": { "@timestamp": "asc"},
   "query": {
      "match_all": {}
   }
}

```

But I don't know how create this kind of visualization.

Could you help me?

Thank you very much

---

<div class="post-metadata">

**Author:** ![Marta\_Bondyra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marta_bondyra/32/102122_2.png) [@Marta\_Bondyra](https://discuss.elastic.co/u/Marta_Bondyra)\
**Post date:** [March 21, 2022, 1:01pm UTC](https://discuss.elastic.co/t/how-create-a-visualization-with-the-last-date-of-document/299938/2 "2022-03-21T13:01:01Z")

</div>

Hello,  
what kind of visualization you have in mind? An example for a datatable (same config would work for any aggregation)

![Screenshot 2022-03-21 at 14.00.17](https://us1.discourse-cdn.com/elastic/original/3X/1/8/1862901c420d0608649d9d56cc0085891a98ffb0.png)

 ![Screenshot 2022-03-21 at 14.00.15](https://us1.discourse-cdn.com/elastic/original/3X/7/6/7661b8b0630ba76a6a3ddcc9bd3b1eb74fdf9a33.jpeg)

---

<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 18, 2022, 1:01pm UTC](https://discuss.elastic.co/t/how-create-a-visualization-with-the-last-date-of-document/299938/3 "2022-04-18T13:01:56Z")

</div>

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