Splunk Search

Sum of particular field values

Madhusri
Engager

Hi,

Current table

Madhusri_0-1630406469520.png

Expected

fstatuscount
success604
Userdefined39

 

Need to sum the "password mismach","policy policy constraint violation","reset token expired","unexpected error setting password" and save it to as new value named "user defined" 

and need to rename the empty value in fstatus field to success.

Anyone please help on this.

Regards,

Madhusri R

Labels (1)
Tags (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Madhusri,

you have to create an eval command to define the fstatus of your transactions, something like this:

index=your_index
| eval status=if(fstatus="password mismach" OR fstatus="policy policy constraint violation" OR fstatus="reset token expired" OR fstatus="unexpected error setting password","user defined","success")
| stats count BY status

Ciao.

Giuseppe

PickleRick
SplunkTrust
SplunkTrust

"Prettier" solution probably could be made using a lookul translating from one set of codes into another set of categories.

But even with a simple eval, instead of a multi-or-ed conditon I'd rather use a case statement - that's a bit more flexible and easy to maintain IMHO.

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,  ...