Splunk Search

IF NOT condition is not working in eval token in my the search query

man03359
Communicator

Hi,

I am trying to create 2 fields based on if condition. If in the logs, 200 Emv error or NoAcquirerFoundConfigured prints, capture it under Failed else print every other error under Declined.

eval Failed=if((Failure_Message=="200 Emv error " OR Failure_Message=="NoAcquirerFoundConfigured "),1,0)
eval Declined=if((Failure_Message!="200 Emv error " OR Failure_Message!="NoAcquirerFoundConfigured "),1,0)

But when my declined seems to print the 200 Emv error as well when I filter with search Declined=1

Sample logs - 

13/07/2023 12:26:51 (01) >> AdyenProxy::AdyenPaymentResponse::ProcessResponse::Response -> Result : Failure 13/07/2023 12:26:51 (01) >> AdyenProxy::AdyenPaymentResponse::ProcessPaymentFailure::Additional response -> Message : 200 Emv error ; Refusal Reason : 200 Emv error 

Labels (3)
0 Karma

yuanliu
SplunkTrust
SplunkTrust

Logically, Failure_Message!="200 Emv error " OR Failure_Message!="NoAcquirerFoundConfigured " and Failure_Message=="200 Emv error " are not mutually exclusive.  Any reason why Declined=1 should NOT include the latter?

0 Karma

man03359
Communicator

Yes, in my logs I am getting multiple errors printed but need to monitor only 2 errors : 200 Emv error and NoAcquirerFoundConfigured. So, I am using the logic -

if failure_message is equal to 200 Emv error or NoAcquirerFoundConfigured, it prints under Failed and rest every other error which is not equal to 00 Emv error or NoAcquirerFoundConfigured should come under Declined

Hence, 

eval Failed=if((Failure_Message=="200 Emv error " OR Failure_Message=="NoAcquirerFoundConfigured "),1,0)

eval Declined=if((Failure_Message!="200 Emv error " OR Failure_Message!="NoAcquirerFoundConfigured "),1,0)

0 Karma

yuanliu
SplunkTrust
SplunkTrust

The logical problem is, OR Failure_Message!="NoAcquirerFoundConfigured " does not preclude Failure_Message=="200 Emv error ".  There is no mutual exclusivity.

0 Karma

man03359
Communicator

This looks to be working - 

eval Msg=if((Failure_Message=="200 Emv error " OR Failure_Message=="NoAcquirerFoundConfigured "),"Failed","Declined")

 

Thanks a lot 🙂 

Happy Splunking

0 Karma
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...