Splunk Search

case match command

parkertctr
Path Finder

I am trying to use the case match command with more than one option. I keep getting an error message regarding the parenthesis.. nothing is working.. Do not understand whats missing from the syntax.   Here is the search -->

| eval state_ack_error=case(match(_raw, "ACK\-CODE\=AA"), 1, match(_raw matches "STATUS\=SENT"), 1, 1=1, 0)

Error message: Error in 'eval' command: The expression is malformed.

Labels (2)
Tags (2)
0 Karma

somesoni2
SplunkTrust
SplunkTrust

Your second match command is not written in correct syntax. Try this:

|  eval state_ack_error=case(match(_raw,"ACK\-CODE\=AA"), 1, match(_raw, "STATUS\=SENT"), 1, 1=1, 0)

parkertctr
Path Finder

Thank you. 

0 Karma
Get Updates on the Splunk Community!

Streamline Data Ingestion With Deployment Server Essentials

REGISTER NOW!Every day the list of sources Admins are responsible for gets bigger and bigger, often making the ...

Remediate Threats Faster and Simplify Investigations With Splunk Enterprise Security ...

REGISTER NOW!Join us for a Tech Talk around our latest release of Splunk Enterprise Security 7.2! We’ll walk ...

Introduction to Splunk AI

WATCH NOWHow are you using AI in Splunk? Whether you see AI as a threat or opportunity, AI is here to stay. ...