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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...