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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...