Alerting

How to setup a simple alert on a simple search result/value

HattrickNZ
Motivator

How do I setup an alert based on the value returned from a search?

I havea simple search:
index=core ....| stats max(kpi) as kpi

This gives a value of 30,000

Now I want to set up an alert that when this goes below 10,000 to trigger an alert. I will use an email initially for testing.

How do I do this? Once I have the search ready I click Save as -> Alert and these options are presented

alt text

my specific query is around the Trigger Alert when. The options are:
1. Number of Results

2. Number of Hosts
3. Number of Sources
4. Custom

None of these seem to be what I want. I was expecting a value of search as an option in that when then value is <10,000 Alert me. What am I missing here? The custom option does not appear to offer anything.

I am reading here

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Try this query

index=core ....| stats max(kpi) as kpi | where kpi < 10000

And have the alert trigger when the number of events is not zero.

---
If this reply helps you, an upvote would be appreciated.

HattrickNZ
Motivator

Just to confirm:
1/ when kpi is 9,000, then kpi< 10,000 is TRUE and a value will be returned from the search (e.g.9000), And the alert will alert.
2/ when kpi is 11,000, then kpi< 10,000 is FALSE and a value will NOT be returned from the search (e.g.No results found). No alert.

is the number of events is not zero relate to the value of 9,000 returned or No results found?
tks

0 Karma
Register for .conf21 Now! Go Vegas or Go Virtual!

How will you .conf21? You decide! Go in-person in Las Vegas, 10/18-10/21, or go online with .conf21 Virtual, 10/19-10/20.