Splunk Search

Graphing windows system from uptime to downtime

matthewhaswell
Path Finder

I have a query that provides windows startup, ending and duration - however I was looking for a way to graph this?

The query is:

SourceName=EventLog EventCode=6005 OR EventCode=6006 | transaction host startswith=6005 endswith=6006

I'm looking for a graphical representation of when the small number of PC's are switched on until they are switched off.

Any ideas?

Matt

Tags (2)
0 Karma

martin_mueller
SplunkTrust
SplunkTrust

I'm not quite sure what you're looking for in a graph, but here's a stab in the dark:

SourceName=EventLog EventCode=6005 OR EventCode=6006 | eval upordown = if(EventCode=6005, -1, 1)
| streamstats sum(upordown) as pcCount | timechart avg(pcCount)

This basically treats each event as either a +1 or a -1, and tots up the running total before charting it. Experiment with sorting the data either way before the streamstats, depending on what you want to see you'll get weird-looking results one way or the other.

Another way to approach this is using transaction | concurrency:

SourceName=EventLog EventCode=6005 OR EventCode=6006 | transaction host startswith=6005 endswith=6006
| concurrency duration = duration | timechart avg(concurrency) as pcCount

Try both and see what you like more.

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...