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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...