Splunk Search

Over a week's timespan, how do I display how many restarts are happening per day on a host?

orchapellico
Explorer

I am getting a bunch of nulls in my results and I'm not sure why. I am trying to build a graph that will show over a business week how many times a server is restarted. Then display is by day and host, on which days with a proper count.

host="" "Server startup" | chart count by host, date_wday

Is there a better way? I was trying to do it with the timechart command, but i'm running into problems there.

Tags (1)
0 Karma
1 Solution

Vijeta
Influencer

You can use below query-

 host="" "Server startup"| eval day=strftime(_time, "%A")| chart count by host day

View solution in original post

0 Karma

Vijeta
Influencer

You can use below query-

 host="" "Server startup"| eval day=strftime(_time, "%A")| chart count by host day
0 Karma

orchapellico
Explorer

Thank you, this is exactly what I was looking for.

0 Karma

akocak
Contributor
host="" "Server startup" | chart count by host, date_wday usenull=false

However, If I were you, I would try to find another variable like "restart time" and use dc. also this may do it

...| timechart count by host span=1d usenull=false

Also this would do it:

host="" "Server startup" | bin _time span=1d| stats count by _time, host
0 Karma

Vijeta
Influencer

Do your events have date_wday field. Looks like the events dont have this field that's why resulting into NULL.

0 Karma

orchapellico
Explorer

They are not all showing up at null, that is what is throwing me off. If there is another way to do this, I would like to know. Thank you for your thoughts.

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 ...