Splunk Search

When stats command is used in the query and statistics results show no results found , will alert be sent?

gu255363
New Member

When I run a query using stats count , I can see Events count as "636 events (4/26/18 8:00:00.000 AM to 5/3/18 8:32:45.000 AM)"

but when i open the Events tab , it shows Your search did not return any events because you are in Fast Mode. Search in Verbose Mode to see the events. The same message displays for Smart mode as well.

and in all the 3 modes , Statistics count is zero.

In this case , an scheduled email alert for the query , wouldn't be triggered because Statistics count is zero? Is this correct?

Tags (1)
0 Karma

woodcock
Esteemed Legend

Whenever you use stats (or chart or timechart or ... or xyseries, etc.), your UI moves to the stats tab which means that the alert will also use that tab. So if your alert condition is Number of events > 0, it means on the stats tab. So the behavior is correct.

0 Karma

somesoni2
Revered Legend

It would depend upon the alert condition you've set while setting up the alert. If your alert conditions says "if number of result is greater than 0", then if stats count is zero, no alert will be fired.

The event count below the search bar shows the event count matched your search criteria, before aggregation. The count on "Statistics" tab would show the actual result returned by your full search. The alert condition uses the result count not the event count.

0 Karma

xpac
SplunkTrust
SplunkTrust

Yes, it's correct. 🙂
When for example your initial query contains results, but you're doing a | stats by somefield, and that somefield doesn't exist in any those events, you get 0 results. An alert that aims for more than 0 results would therefore not fire.

Hope that helps - if it does I'd be happy if you would upvote/accept this answer, so others could profit from it. 🙂

0 Karma
Get Updates on the Splunk Community!

Introduction to Splunk Observability Cloud - Building a Resilient Hybrid Cloud

Introduction to Splunk Observability Cloud - Building a Resilient Hybrid Cloud  In today’s fast-paced digital ...

Observability protocols to know about

Observability protocols define the specifications or formats for collecting, encoding, transporting, and ...

Take Your Breath Away with Splunk Risk-Based Alerting (RBA)

WATCH NOW!The Splunk Guide to Risk-Based Alerting is here to empower your SOC like never before. Join Haylee ...