Splunk Search

Stop search after events matched

yuwtennis
Communicator

Hi!

I would like to ask question related to following thread.

http://answers.splunk.com/answers/8107/return-only-the-first-matching-event

Similar situation but bit different.

I have a search

index=A
| lookup Pack OUTPUT status
| where status="updated"
| stats first(fieldA) by Pack

If I execute above search , result is fine but
it keeps searching until end of indexA.

I want to stop the search after all the first() are returned.

Is this possible?

Thanks,
Yu

Tags (2)
0 Karma

Ayn
Legend

The problem is that until Splunk has checked all events, it can't know if it has found all the values of Pack, so it has to continue matching. If you know how many values of Pack exist, you can add a |head <N> after your stats command to make the search stop once it's found N values for Pack.

0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...