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!

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

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

Updated Data Type Articles, Anniversary Celebrations, and More on Splunk Lantern

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

A Prelude to .conf25: Your Guide to Splunk University

Heading to Boston this September for .conf25? Get a jumpstart by arriving a few days early for Splunk ...