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!

SOCin’ it to you at Splunk University

Splunk University is expanding its instructor-led learning portfolio with dedicated Security tracks at .conf25 ...

Credit Card Data Protection & PCI Compliance with Splunk Edge Processor

Organizations handling credit card transactions know that PCI DSS compliance is both critical and complex. The ...

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

What are Community Office Hours?Community Office Hours is an interactive 60-minute Zoom series where ...