Splunk Search

Exit during search?

yuwtennis
Communicator

Hi!

Is it possible to exit during the search ?

For example,

search index=xxx [ search xxxxx format ]

If above sub search returns 0 events exit the search.

Thanks,
Yu

Tags (2)
0 Karma

martin_mueller
SplunkTrust
SplunkTrust

You could hack your way into conditional execution with map:

some search that returns either one or zero results | map search="the other search"

map will run "the other search" for each event returned by "some search...", so if "some search..." returns one event it will run "the other search" once and if it returns zero events it will not run "the other search" at all.

HiroshiSatoh
Champion

This is a mistake?
search index=xxx [ search xxxxx format ]
search index=xxx [ search xxxxx |format ]

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 ...