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!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...