Splunk Search

how to use count(eval(httpstatus="2*")) as success count(eval(httpstatus!="2*")) as failed in search query

mvaradarajam
Path Finder

Hi All,

how to use count(eval(httpstatus="2*")) as success count(eval(httpstatus!="2*")) as failed in search query

Tags (1)
0 Karma

strive
Influencer

http status codes 3* are not considered as errors. If you need pure errors then

some search terms | stats count(eval(searchmatch("httpstatus=2*"))) as success count(eval(searchmatch("httpstatus!=2*"  AND httpstatus!=3*" ))) as failed
0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Without any more info I'm going to take a wild guess at what you might want:

some search terms | stats count(eval(searchmatch("httpstatus=2*"))) as success count(eval(searchmatch("httpstatus!=2*"))) as failed
0 Karma
Get Updates on the Splunk Community!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...