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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...