Alerting

Is there a Splunk search command that raises an alert when a host's count is high compared to other hosts?

bishtk
Communicator

Dear All,

I need help raising an alert that would return which host has a higher count than the others. Below is the output of my search query. Please suggest the comparison or suitable command to this issue.

host count
ABC 1349
DEF 1598
GHI 1123
KLM 1150
NOP 1329

0 Karma

adonio
Ultra Champion

hello there, hope i understand your requirement
try this:

| tstats count as event_count where index=* by host
| sort 1 -event_count

change the number after sort to show how many hosts with the most events will appear in your results

0 Karma

jkat54
SplunkTrust
SplunkTrust

What about | top 1 instead of sort?

Sort has a 10k limit by default.

0 Karma

mstjohn_splunk
Splunk Employee
Splunk Employee

Hi @kundanbisht,

Thank you for posting your search outputs above. But would you mind posting the search that you tried, even though it didn't work? Generally, our community is more inclined to help out if they have more to go on.

Happy Splunking!

0 Karma
Get Updates on the Splunk Community!

Enhance Security Visibility with Splunk Enterprise Security 7.1 through Threat ...

(view in My Videos)Struggling with alert fatigue, lack of context, and prioritization around security ...

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...

Adoption of Infrastructure Monitoring at Splunk

  Splunk's Growth Engineering team showcases one of their first Splunk product adoption-Splunk Infrastructure ...