Splunk Search

Why IQR shows me only 10,000 results ?

zacksoft
Contributor

I'm trying to find outlier using IQR method suggested by Splunk. I wonder why the statistics only shows 10,000 results !
https://docs.splunk.com/Documentation/Splunk/6.5.0/Search/Findingandremovingoutliers

Tags (1)
1 Solution

cmerriman
Super Champion

are you using the sort command? sort automatically truncates results. try |sort 0 -<fieldname>
http://docs.splunk.com/Documentation/Splunk/6.5.0/SearchReference/Sort

View solution in original post

mayurr98
Super Champion

can you share your search query?

0 Karma

zacksoft
Contributor

| eval _time=(round(strptime(time, "%Y-%m-%d %H:%M:%SZ")))
| eventstats median("Run_Time") as median p25("Run_Time") as p25 p75("Run_Time") as p75
| eval IQR=(p75-p25)
| eval lowerBound=(median-IQR)
| eval upperBound=(median+IQR*20)
| eval isOutlier=if('Run_Time' < lowerBound OR 'Run_Time' > upperBound, 1, 0)
| fields "_time", "symbol", "sourcetype", "time", "Run_Time", "lowerBound", "upperBound", "isOutlier"
| table _time, symbol, sourcetype, time, Run_Time, lowerBound, upperBound, isOutlier
| sort -isOutlier

0 Karma

cmerriman
Super Champion

are you using the sort command? sort automatically truncates results. try |sort 0 -<fieldname>
http://docs.splunk.com/Documentation/Splunk/6.5.0/SearchReference/Sort

zacksoft
Contributor

Adding |sort 0 - helped. But in statistics tab it still shows as 10,000 entries.
Is this something to do with IQR approach ?

While I attempted the "lower and upper boundaries of an acceptable range to identify outliers" , there also it was 10,000 values !!!

0 Karma

cmerriman
Super Champion

can you share your search?

0 Karma

zacksoft
Contributor

This is using IQR.

| eval _time=(round(strptime(time, "%Y-%m-%d %H:%M:%SZ")))
| eventstats median("Run_Time") as median p25("Run_Time") as p25 p75("Run_Time") as p75
| eval IQR=(p75-p25)
| eval lowerBound=(median-IQR)
| eval upperBound=(median+IQR*20)
| eval isOutlier=if('Run_Time' < lowerBound OR 'Run_Time' > upperBound, 1, 0)
| fields "_time", "symbol", "sourcetype", "time", "Run_Time", "lowerBound", "upperBound", "isOutlier"
| table _time, symbol, sourcetype, time, Run_Time, lowerBound, upperBound, isOutlier
| sort -isOutlier

0 Karma

cmerriman
Super Champion

you're going to need | sort 0 -isOutlier on the end to remove the 10,000 limit. the rest of it shouldn't matter. you also don't need both fields and table, you can just use one or the other.

0 Karma

zacksoft
Contributor

Thank you @cmerriman

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...