Splunk Search

How to use detect numeric outlier to detect cpu utilization outlier

waihoong
New Member

My objective is to collect cpu utilization and then use detect numeric outlier to find out the odds one. However the values in the outlier is not the real percentage of my cpu utilization but more of counts of events. What command should i use in order to plot outlier graph with my real cpu percentage?

command i'm using:
Part 1
sourcetype=csv source=cpu "Node Name"=host*

earliest=-14d | bin _time span=5m
| stats count by _time
| eventstats avg("count") as avg max("count") as Maximum
| eval count=if(count=Maximum, avg, count)
| eventstats avg("count") as avg stdev("count") as stdev
| eval lowerBound=(avg-stdev*exact(4)), upperBound=(avg+stdev*exact(4))
| fields lowerBound, upperBound
| dedup lowerBound, upperBound
| fields - _time
| outputlookup utilization.csv

Part 2:
| bin _time span=5m
| stats count by _time
| eval lowerBound=0
| eval upperBound=[|inputlookup utilization.csv | return $upperBound]
| eval isOutlier=if( count > upperBound, 1, 0)
| fields _time, count, lowerBound, upperBound, isOutlier, *

Part 1 is to collect the utilization percentage and calculate the upper boundary
part 2 is to use the boundary calculated in part 1 and used it to detect outlier

However, the boundary should be less than 100 as this is a utilization percentage, the value I calculated is 500+ which makes me believe it is the count of event and not the value itself.

Tags (2)
0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...