Splunk Search

Help with Boolean query

TheBravoSierra
Path Finder

Below is an example of what I want to accomplish:

 

If x="example" and y="success", return true for this segment. 

If x="example2" and y="success", return true for this segment.

If x="example3" and y="success", return true for this segment.

If all are three statements = true, return true. If not all three = true, return false.

 

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@TheBravoSierra 

Are you looking for this?

YOUR_SEARCH  | eval flag=if((x="example" OR x="example2" OR x="example3") and y="success", "true", "false")

 

My Sample Search :

| makeresults | eval x="example",y="success" |append [| makeresults | eval x="example2",y="failed" ]  | eval flag=if((x="example" OR x="example2" OR x="example3") and y="success", "true", "false")


 

0 Karma
Get Updates on the Splunk Community!

Prove Your Splunk Prowess at .conf25—No Prereqs Required!

Your Next Big Security Credential: No Prerequisites Needed We know you’ve got the skills, and now, earning the ...

Splunk Observability Cloud's AI Assistant in Action Series: Observability as Code

This is the sixth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Splunk Answers Content Calendar, July Edition I

Hello Community! Welcome to another month of Community Content Calendar series! For the month of July, we will ...