Alerting

Why does the trigger condition for my alert never work?

splunkrocks2014
Communicator

Hi.

I created an alert and tried to trigger a python script to capture the parameters if the alert condition is set as "if number of events" "is greater than" "0". However, the trigger condition never works until I set it as "Always". I have tried all different options to include custom set as "search count>0", and none of them work, although there were results from the alert. Any clues?

index=xyz sourcetype=xyz:abc c_host=myhostname | table c_ip cs_path

start time: -5m
finish time: now

0 Karma

jluo_splunk
Splunk Employee
Splunk Employee

Hi Splunkrocks2014,

The custom condition is typically set using the search command (see example: http://docs.splunk.com/Documentation/Splunk/6.1/Alert/Alertexamples)

I think you may need to change your base search a bit. If I understand your question correctly, you may be looking for something like this as your base search..

index=xyz sourcetype=xyz:abc c_host=myhostname | stats count by c_ip, cs_path

From here, you can create your alert, and set your custom condition to be something like "search count > 0", or whatever number you like.

0 Karma

frobinson_splun
Splunk Employee
Splunk Employee

Hi @splunkrocks2014,
What software version are you using?

What kind of alert did you create (real-time/scheduled)?

This is more of experimental question, but could you possibly test the alert without the "table" command at the end? If you leave "table" out but use your original condition for events > 0, does the alert trigger as expected?

0 Karma

splunkrocks2014
Communicator

It works by removed "table" command. That means the condition doesn't support "table" command?

Splunk Enterprise: 6.3.2
Alert: scheduled every 5 mins

0 Karma
Get Updates on the Splunk Community!

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...