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!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

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

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...