Splunk Search

Trying to chart process over time unsuccessfully with CPU query

mightaswelby
Explorer

Able to get the expected value running this query, however how would I plot this over time as a timechart?

sourcetype=Script:RunningProc eventtype=Security-proc1 | appendpipe [stats avg(CPUPct) as "CPU %" by Instance] | stats sum(CPU %)

output:
sum(CPU %)
0.156074

0 Karma
1 Solution

somesoni2
Revered Legend

Try this

sourcetype=Script:RunningProc eventtype=Security-proc1
| timechahrt avg(CPUPct) by instance

View solution in original post

0 Karma

somesoni2
Revered Legend

Try this

sourcetype=Script:RunningProc eventtype=Security-proc1
| timechahrt avg(CPUPct) by instance
0 Karma

mightaswelby
Explorer

Thanks for the response somesoni2, however in order to produce the accurate value, the | stats sum(CPU %) needs to be included in the query. (issues with the way windows perfmon passes cpu data). looking to timechart the result sum(CPU % over a period of time and having no luck.

sourcetype=Script:RunningProc eventtype=Security-proc1 | appendpipe [stats avg(CPUPct) as "CPU %" by Instance] | stats sum(CPU %)

output:
sum(CPU %)
0.156074

0 Karma

somesoni2
Revered Legend

How about this? (update span value in bucket command and timechart command per your need)

sourcetype=Script:RunningProc eventtype=Security-proc1 | bucket span=15m _time | stats avg(CPUPct) as "CPU %" by _time instance | timechart span=15m sum("CPU %")  as "CPU %"
0 Karma

mightaswelby
Explorer

This seemed to work perfectly, thank you somesoni2

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