Splunk Search

How to find more than 3 heartbeat failure with failure reason from same host in a day and put in a table?

navan1
Explorer

Hi All,

How to find more than 3 heartbeat failure with failure reason from same host in a day  and put in a table?

I am currently using below search,

Index="my index" sourcetype="my sourcetype" action="heartbeatfailure" 
|bucket _time span=day
|stats count by _time host action failure_reason
|where count>2 

As the failure reason is different i am unable to get result for the same host in  past 24 hrs.  How to get stats count by _time, host, action with failure_reason in same table?

Labels (2)
0 Karma

johnhuang
Motivator

One of these could work:

index="my index" sourcetype="my sourcetype" action="heartbeatfailure" 
| bucket _time span=1d
| eventstats count BY _time host action 
| table _time host action failure_reason count
| where count>2 
index="my index" sourcetype="my sourcetype" action="heartbeatfailure" 
| bucket _time span=1d
| stats count values(failure_reason) AS failure_reason BY _time host action
| table _time host action failure_reason count
| where count>2 

 

ITWhisperer
SplunkTrust
SplunkTrust
Index="my index" sourcetype="my sourcetype" action="heartbeatfailure" 
|bucket _time span=day
|stats count values(failure_reason) as failure_reason by _time host action
|where count>2
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...