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!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...