# Discover: How to show last occurrence?

**URL:** <https://discuss.elastic.co/t/discover-how-to-show-last-occurrence/251700>\
**Category:** Kibana\
**Created:** [October 12, 2020, 2:23am UTC](https://discuss.elastic.co/t/discover-how-to-show-last-occurrence/251700 "2020-10-12T02:23:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nameisnotimportant](https://avatars.discourse-cdn.com/v4/letter/n/ea5d25/32.png) [@nameisnotimportant](https://discuss.elastic.co/u/nameisnotimportant)\
**Post date:** [October 12, 2020, 2:23am UTC](https://discuss.elastic.co/t/discover-how-to-show-last-occurrence/251700/1 "2020-10-12T02:23:02Z")

</div>

Hi,

[edit] my ELK version: 7.8.0  
I am able to get the last occurrence of my data in the console as following:

 ![console_agg1](https://us1.discourse-cdn.com/elastic/original/3X/5/1/5112c496c7190b9cd9f6ec5086d3c67b11d0d1da.png)

However, when i copy the code to Discover, it return 5 results:

 ![console_agg2](https://us1.discourse-cdn.com/elastic/original/3X/c/7/c79bb2c5dccc0d5c7ff8cd4fb80fd95233e06f9a.png)

May i know how do i get Discover to display only the last occurrence result?

---

<div class="post-metadata">

**Author:** ![matw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matw/32/13913_2.png) [@matw](https://discuss.elastic.co/u/matw)\
**Post date:** [October 12, 2020, 11:00am UTC](https://discuss.elastic.co/t/discover-how-to-show-last-occurrence/251700/2 "2020-10-12T11:00:56Z")

</div>

Hi

In your console you're searching a single index. is your used index pattern identical to `t_cust_reg` so it doesn't search more indices? If so could you share the request sent to Elasticsearch, you can use the `Inspect` menu entry of the toolbar for that.

thx & best,  
Matthias

---

<div class="post-metadata">

**Author:** ![matw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matw/32/13913_2.png) [@matw](https://discuss.elastic.co/u/matw)\
**Post date:** [October 12, 2020, 12:14pm UTC](https://discuss.elastic.co/t/discover-how-to-show-last-occurrence/251700/3 "2020-10-12T12:14:45Z")

</div>

So you're trying add a filter with aggregate data here, this is not possible in Discover. This is a good case for using e.g. [TSVB](https://www.elastic.co/guide/en/kibana/current/TSVB.html)

Thx to @Marta_Bondyra, who took a closer look than I did!

---

<div class="post-metadata">

**Author:** ![nameisnotimportant](https://avatars.discourse-cdn.com/v4/letter/n/ea5d25/32.png) [@nameisnotimportant](https://discuss.elastic.co/u/nameisnotimportant)\
**Post date:** [October 13, 2020, 5:58am UTC](https://discuss.elastic.co/t/discover-how-to-show-last-occurrence/251700/4 "2020-10-13T05:58:39Z")

</div>

Thanks Matthias. Will try TSVB.

---

<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 10, 2020, 5:58am UTC](https://discuss.elastic.co/t/discover-how-to-show-last-occurrence/251700/5 "2020-11-10T05:58:53Z")

</div>

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