All Apps and Add-ons

configure alert when results=0

newbiesplunk
Path Finder

Hi, can i configure from the "searches & reports" such that it trigger alert when the results=0 or i need to write a script to trigger such alert. If can configure from "searches & reports" how to go about configuring it. thks

Tags (1)
0 Karma

puneethgowda
Communicator
  1. In search bar search the query which you have for this alert and save as alert and give the alert name. 2.Select Trigger alert when Number of results is grater than your value 3.action send mail
0 Karma

jkat54
SplunkTrust
SplunkTrust

Yes in trigger condition select number of results = 0.

If scripting it, same thing... Usually use something like len(), length(), count, word count (wc), etc to get the length of the results variable/object.

if len(results) == 0:
#do something

0 Karma

niketn
Legend

You can refer to the following Example of setting up alert. The example considers number of results greater than 5, you can set the same up for greater than 0. Trigger if number of results: is greater than 0

http://docs.splunk.com/Documentation/Splunk/latest/Alert/Alertexamples#Set_up_the_alert_2

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...