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!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk on November 6 at 11AM PT, and empower your SOC to reach new heights! Duration: ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...