Splunk Search

How to edit Windows performance search to calculate average CPU time and generate a table that displays processes consuming greater than 50% CPU?

vikas_gopal
Builder

Hi Experts,

I know that we have Splunk App for Windows Infrastructure but I am not using this app. For CPU and Processes, I am using following in wmi.conf:

CPU
[WMI:CPUTime]
interval = 03
wql = SELECT PercentProcessorTime,PercentUserTime FROM Win32_PerfFormattedData_PerfOS_Processor WHERE Name="_Total"
index = abc
disabled = 0

Result
PercentProcessorTime=10
PercentUserTime=4
wmi_type=CPUTime

Question :- Am I calculating correctly the avg CPU time over time?

index=abc source="WMI:CPUTime" |eval overallCPU=PercentProcessorTime+PercentUserTime| timechart avg(overallCPU) AS CPU_Utilization

Processes
[WMI:LocalProcesses]
interval = 30
wql = SELECT Name, IDProcess, PrivateBytes, PercentProcessorTime FROM Win32_PerfFormattedData_PerfProc_Process
index = abc
disabled = 0

Question :- I want to show a table that contains host name, Process name, and CPU_utilization and this table only shows those processes which are consuming more that 50% CPU. Please help me to create this search. The problem I am facing is when creating a sub search, so idea is to get CPU>=50 and corresponding processes.

Regards
VG

0 Karma
1 Solution

jkat54
SplunkTrust
SplunkTrust

For the value of total processor utilization systemwide, use the Processor(_Total)\% Processor Time counter.

https://technet.microsoft.com/en-us/library/cc938593.aspx

View solution in original post

jkat54
SplunkTrust
SplunkTrust

For the value of total processor utilization systemwide, use the Processor(_Total)\% Processor Time counter.

https://technet.microsoft.com/en-us/library/cc938593.aspx

jkat54
SplunkTrust
SplunkTrust

For second question just add this to your search

| where PercentProcessorTime>=50

0 Karma

jkat54
SplunkTrust
SplunkTrust

In other words don't combine percent processor time with percent user time. Just use percent processor time.

0 Karma

vikas_gopal
Builder

I get it thanks man you are awesome.

Get Updates on the Splunk Community!

Data Management Digest – November 2025

  Welcome to the inaugural edition of Data Management Digest! As your trusted partner in data innovation, the ...

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...