Splunk Search

Percentile calculation

chaitu99
Explorer

source="file.txt" | transaction startswith="message1" endswith="message2" | stats count values(duration) as DUR

log file 5 events are matching

count DUR
5 0.095
0.056
0.075
0.064
0.095

I want to calculate the percentage of all events duration coming which is less than 75 miliseconds.

Please let me know how to go ahead.

Tags (1)
0 Karma
1 Solution

martin_mueller
SplunkTrust
SplunkTrust

You could replace your stats with something like this:

... | stats count as total count(eval(duration<0.075)) as count | eval percentage = count * 100 / total

View solution in original post

martin_mueller
SplunkTrust
SplunkTrust

You could replace your stats with something like this:

... | stats count as total count(eval(duration<0.075)) as count | eval percentage = count * 100 / total
Get Updates on the Splunk Community!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

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

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...