Splunk Search

Evaluate multiple events with same data.

biec1
Explorer

I would like to count the number of times a Server went down based on up/down status field.
How can i evaluate multiple(continuous) down into one down status, when i am receiving events every five minutes?
Multiple(continuous) down for one host should be treated as one down.

Time| Server |Status
3:00 AM Host1 up
3:00 PM Host2 down
3:05 PM Host1 up
3:10 PM Host1 up
3:15 PM Host1 down
3:15 PM Host2 up
3:20 PM Host1 up
3:25 PM Host1 down
3:30 PM Host1 up
3:35 PM Host1 up
3:40 PM Host1 down
3:45 PM Host1 down

Tags (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Use the dedup command.

... | dedup Server Status | ...
---
If this reply helps you, Karma would be appreciated.
0 Karma

biec1
Explorer

How can this help me to get the number of the times the server went down in a week?

index=index_names source="rest://" (server="host1" OR server="host2")
| stats latest(_time) as Time values(server_state) as status by server _time
| dedup server status
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Your question was how to evaluate multiple instances of a status value to a single instance. The dedup command does exactly that.
That doesn't tell you how many times a server went down, just the last time the status changed to Up or Down.

---
If this reply helps you, Karma would be appreciated.
0 Karma

biec1
Explorer

I would like to retrieve the number of times a server went down.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...