Dashboards & Visualizations

how to make a new field based on status code

Mohsin123
Path Finder

I've this | eval status=if(CODE=200,"success","failure") 

i need to have 3 fields like success, failure , total

I'm trying this 

| stats eval(if(c(CODE=200))) as success

but its not working 

Could you please help ?

Labels (1)
0 Karma
1 Solution

SanjayReddy
SplunkTrust
SplunkTrust

Hi @Mohsin123 

Can you try this

| stats count(eval(CODE="200")) as "success" count(eval(CODE="<addcodenumber>")) as "failure"  count(CODE) as "total" 


View solution in original post

0 Karma

SanjayReddy
SplunkTrust
SplunkTrust

Hi @Mohsin123 

Can you try this

| stats count(eval(CODE="200")) as "success" count(eval(CODE="<addcodenumber>")) as "failure"  count(CODE) as "total" 


0 Karma
Get Updates on the Splunk Community!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI! Discover how Splunk’s agentic AI ...

[Puzzles] Solve, Learn, Repeat: Dereferencing XML to Fixed-length events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

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

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...