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!

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...

Cloud Monitoring Console - Unlocking Greater Visibility in SVC Usage Reporting

For Splunk Cloud customers, understanding and optimizing Splunk Virtual Compute (SVC) usage and resource ...

Automatic Discovery Part 3: Practical Use Cases

If you’ve enabled Automatic Discovery in your install of the Splunk Distribution of the OpenTelemetry ...