Splunk Search

Count By host

hartfoml
Motivator

I am using this statement below to run every hour of the day looking for the value that is 1 on multiple hosts named in the search. A good startup is where I get 2 or more of the same event in one hour. If I get 0 then the system is running if I get one the system is not running.

search | timechart span=h count by host | where count < 2

I am expecting a total count of 2 of more for each host and if I get an event were count per host is less than 2 I want to get an alert. I actually would like to get an alert if the count is grater than 0 but less than 2. The above statement is not working for me. Any suggestions

Tags (1)
0 Karma
1 Solution
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...