Splunk Search

How to generate a search that displays a cumulative percentage column?

kualo
Explorer

Hi I have the log below.

           score
1              10     
2              22
3              33
4              36
5              55

Each event has a score range from 0~50
I want to have a cumulative percentage column showing that

greater or equal 40 : 20% 
greater or equal 30 : 60%
greater or equal 20 : 80%
greater or equal 10 : 100%
greater or equal  0 : 100%
0 Karma

sundareshr
Legend

Try this

... | bin span=10 score | stats count by score | eventstats sum(count) as total | eval percentage=round(count/total, 0)*100 | eval percentage=tostring(percentage, "commas")."%" | replace * WITH "greater or equal to "* IN score | table score percentage
0 Karma
Get Updates on the Splunk Community!

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

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...