Splunk Search

How to return exact percentile values in a Splunk search?



I have an issue with percentile functions provided by SPLUNK.

Example: I am getting count by last 7 days as :


If I am asking for 90th perc of above value, it's always showing me 22 as a value, not in between like 20 or 21, or if I expect the 80th percentile, it's giving me 18, not 19 or 20. This means it's taking data from the result set, not in between and I'm expecting exact percentiles. Could you please help me to know how we could achieve this in splunk ?

I tried all functions provided by Splunk like perc, p, exactperc etc. but results are not changing.

Tags (2)


I'm pretty sure that both perc() and exactperc() use the Nearest Rank method: https://en.wikipedia.org/wiki/Percentile#The_Nearest_Rank_method
The difference appears to be that for high-cardinality fields perc() might not be accurate for sake of performance so you can use exactperc() to force Splunk to be accurate (within the Nearest Rank method) without regard for expensive computations.

0 Karma
Get Updates on the Splunk Community!

Splunk Education - Fast Start Program!

Welcome to Splunk Education! Splunk training programs are designed to enable you to get started quickly and ...

Five Subtly Different Ways of Adding Manual Instrumentation in Java

You can find the code of this example on GitHub here. Please feel free to star the repository to keep in ...

New Splunk APM Enhancements Help Troubleshoot Your MySQL and NoSQL Databases Faster

Splunk Observability has two new enhancements to make it quicker and easier to troubleshoot slow or frequently ...