Splunk Search

How to get percentage from stats count on http statuses?

xvxt006
Contributor

Hi,

I would like to get stats by http status and also i would like to add percentage column. when i use top it gives by uri or some other field which i don't want.

Right now output looks like this. But i need to add percentage.
status count
200 557374
301 151
302 61
400 33
404 542
405 24
500 6541

Tags (2)
1 Solution

somesoni2
SplunkTrust
SplunkTrust

Try something like this

your base search | stats count by status | eventstats sum(count) as perc | eval perc=round(count*100/perc,2)

View solution in original post

somesoni2
SplunkTrust
SplunkTrust

Try something like this

your base search | stats count by status | eventstats sum(count) as perc | eval perc=round(count*100/perc,2)
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...