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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...