Splunk Search

Can anyone please help in finding percent_rank of a field

sahil237888
Path Finder

Can anyone please help what could be the equivalent to SQL's "percent_Rank" command in splunk

select host, count(*) "pings",
TRUNC(PERCENT_RANK(200) WITHIN GROUP (ORDER BY proc_time) * 100, 2) || '%' "PingTime (% < 50 mSec)" from servers GROUP BY host ORDER BY 2 DESC
0 Karma

to4kawa
Ultra Champion
your search
| top limit=200 proc_time by host
| eval "PingTime (% < 50 mSec)"=round(percent,2)."%"

It is like this.

0 Karma

woodcock
Esteemed Legend

You should just be able to pipe your data to top and get what you need:
https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Top
Or, if you mean percentiles, then you can use stats percX(Y) function for that:
https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Aggregatefunctions#perc.26lt.3BX...

0 Karma

oscar84x
Contributor

I am not familiar with that command but perhaps some of the functions in the link below could help?

https://docs.splunk.com/Documentation/Splunk/8.0.0/SearchReference/Aggregatefunctions

0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...