Alerting

How to trigger an alert based on the number of rows in the "Statistics" tab?

dwh_splunk
Explorer

I have a saved search, that starts with a dbquery | dbquery, then does some transformations and ends with a collect statement.

When I run this search manually, there are resulting events and all results go to the "Statistics" tab.
I want to monitor, if indeed data was collected by my saved search.

This does not do the trick:

counttype = number of events
quantity = 1
relation = less than

simply because there are no resulting events.

Is there a way to trigger an alert based on the number of rows in the "Statistics" tab?

0 Karma

mcronkrite
Splunk Employee
Splunk Employee

When you run the Splunk Search that you want an alert for go to the top right and save as. There is an option for Save as Alert. The options include the count of the rows and lots of other options.

Here is an example:
http://docs.splunk.com/Documentation/Splunk/6.3.3/Alert/Alertexamples

0 Karma

woodcock
Esteemed Legend

Passing events to the collect command does not destroy the events so you can just tack this on to the end of your search and trigger off of count:

... | stats count
0 Karma

Richfez
SplunkTrust
SplunkTrust

If your search ends with collect - those results go somewhere else.

Can you write another search that queries the summary index over the appropriate time span to get your statistics?

0 Karma

Richfez
SplunkTrust
SplunkTrust

Is there any way you could paste the search itself?

0 Karma

somesoni2
Revered Legend

Which version of splunk you're using?

0 Karma

dwh_splunk
Explorer

version 6.1.1

0 Karma
Get Updates on the Splunk Community!

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Accelerating Observability as Code with the Splunk AI Assistant

We’ve seen in previous posts what Observability as Code (OaC) is and how it’s now essential for managing ...