# Discover - Limit events returned

**URL:** https://discuss.elastic.co/t/discover-limit-events-returned/101048
**Category:** Kibana
**Created:** [September 19, 2017, 4:15pm UTC](https://discuss.elastic.co/t/discover-limit-events-returned/101048 "2017-09-19T16:15:16Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![KRasekhi](https://avatars.discourse-cdn.com/v4/letter/k/85e7bf/32.png) [@KRasekhi](https://discuss.elastic.co/u/KRasekhi)
#### Post date: [September 19, 2017, 4:15pm UTC](https://discuss.elastic.co/t/discover-limit-events-returned/101048/1 "2017-09-19T16:15:16Z")

</div>

Is it possible to limit the number of results returned from a discover search? For example I just want the last event indexed for a particular field.

I was able to do this in a visualization by taking the max @timestamp and then bucket -\> Split rows by Term but it would return a table that included both @timestamp AND term. I just want the term.

Thanks!

---

<div class="post-metadata">

### Author: ![BigFunger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bigfunger/32/7323_2.png) [@BigFunger](https://discuss.elastic.co/u/BigFunger)
#### Post date: [September 19, 2017, 7:21pm UTC](https://discuss.elastic.co/t/discover-limit-events-returned/101048/2 "2017-09-19T19:21:16Z")

</div>

I _think_ I understand what you're shooting for.

If you go into the `Management` section, and select `Advanced Settings`, there is a `'discover:sampleSize'` setting. Change that to `1`.

Does that accomplish that you want?

---

<div class="post-metadata">

### Author: ![KRasekhi](https://avatars.discourse-cdn.com/v4/letter/k/85e7bf/32.png) [@KRasekhi](https://discuss.elastic.co/u/KRasekhi)
#### Post date: [September 19, 2017, 7:31pm UTC](https://discuss.elastic.co/t/discover-limit-events-returned/101048/3 "2017-09-19T19:31:56Z")

</div>

I thought about that option but won't the result be all of my discover searches returning only 1 event? I was hoping to save specific searches that only return 1 event (the latest indexed) and the rest return the normal settings amount.

---

<div class="post-metadata">

### Author: ![BigFunger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bigfunger/32/7323_2.png) [@BigFunger](https://discuss.elastic.co/u/BigFunger)
#### Post date: [September 19, 2017, 7:41pm UTC](https://discuss.elastic.co/t/discover-limit-events-returned/101048/4 "2017-09-19T19:41:22Z")

</div>

Unfortunately I don't think there is a more clean way to accomplish what you're looking for. ☹

There is a current feature request for this, although I don't think it's high on the priority list at the moment. Feel free to weigh in there!

> <https://github.com/elastic/kibana/issues/3220>

---

<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: [October 17, 2017, 7:41pm UTC](https://discuss.elastic.co/t/discover-limit-events-returned/101048/5 "2017-10-17T19:41:22Z")

</div>

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