Splunk Search

How do I search if HTTP status for error codes is more than 5% of the overall request, but exclude error code 401?

marees123
Path Finder

Hi All,

I need helping writing a search.

If HTTP status for error codes is more than 5% of the overall request (exclude 401error code)

Please help. Thanks.

0 Karma
1 Solution

woodcock
Esteemed Legend

Like this:

... | timechart span=1h count as total count(eval(tonumber(http_status)>=400)) AS statusCount400andUp count(eval(tonumber(http_status)=401)) AS statusCount401 | eval pctMyBad = 100*(statusCount400andUp - statusCount401)/total | where pctMyBad > 5

View solution in original post

woodcock
Esteemed Legend

Like this:

... | timechart span=1h count as total count(eval(tonumber(http_status)>=400)) AS statusCount400andUp count(eval(tonumber(http_status)=401)) AS statusCount401 | eval pctMyBad = 100*(statusCount400andUp - statusCount401)/total | where pctMyBad > 5

marees123
Path Finder

thanks a lot:-)

0 Karma

davebrooking
Contributor

Does the following link help? link text

Dave

marees123
Path Finder

Thanks:-).

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

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