Splunk Search

How to edit my search to add a third column to my table results if there are certain values in the first

athorat
Communicator

I want to add a column "FinalType" in a statistical table, so when the EventType=ScoreLock and TxnType=Renewal, it should show the value "Scorelock" in the FinalType column. The results should look like this:

EventType           TxnType              FinalType

ScoreLock           Renewal              ScoreLock  
Bind                 Endorsement          Exception     
Renewal Offer       Renewal           EUBI

I am currently using this search to display these results:

index="np_dpa" sit-api-monitor  EventType="[request]" OR EventType="[error]"  PROXYNAME="mpgw_RecordUBIVehicleScore"|stats count by eventType transactionType 
0 Karma
1 Solution

somesoni2
Revered Legend

How about this

index="np_dpa" sit-api-monitor EventType="[request]" OR EventType="[error]" PROXYNAME="mpgw_RecordUBIVehicleScore"|stats count by eventType transactionType  | eval FinalType=case(eventType="ScoreLock" AND transactionType="Renewal","ScoreLock",eventType="Bind" AND transactionType="Endorsement","Exception",1=1,"EUBI")

View solution in original post

somesoni2
Revered Legend

How about this

index="np_dpa" sit-api-monitor EventType="[request]" OR EventType="[error]" PROXYNAME="mpgw_RecordUBIVehicleScore"|stats count by eventType transactionType  | eval FinalType=case(eventType="ScoreLock" AND transactionType="Renewal","ScoreLock",eventType="Bind" AND transactionType="Endorsement","Exception",1=1,"EUBI")
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,  ...