Splunk Search

Grouping multiple OR values

babakkhorshid
New Member

Hi People,
Is there any efficient way of grouping values?
I have like 20 Or statement that I need to match
something like
("x" OR "Y" OR "Z" OR "A" OR "B" OR "C")

Is there any expression like
any of (x,y,z,a,b,c) ?

0 Karma
1 Solution

renjith_nair
Legend

@babakkhorshid,

Try,

field_name IN(x,y,z,a,b,c)

Reference : Multiple field-value comparisons with the IN operator

---
What goes around comes around. If it helps, hit it with Karma 🙂

View solution in original post

0 Karma

renjith_nair
Legend

@babakkhorshid,

Try,

field_name IN(x,y,z,a,b,c)

Reference : Multiple field-value comparisons with the IN operator

---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma

babakkhorshid
New Member

Thanks Renjith

I think this would solve my issue.

But out of interest:
What if the field_Name is not the same.

Like we have Multiple events (like Phrases or words we need to match) in multiple fields?

example: "200" "201" "202" "203" "204" in fields A, B and C

Much appreciate your help and Thanks

0 Karma

renjith_nair
Legend

@babakkhorshid ,
Thanks. Please accept as answer if it's working for you.

For handling different field name, you may use field alias and use the alias in search as described in https://docs.splunk.com/Documentation/Splunk/7.3.1/Knowledge/Addaliasestofields

---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma
Get Updates on the Splunk Community!

Observability Unlocked: Kubernetes Monitoring with Splunk Observability Cloud

  Ready to master Kubernetes and cloud monitoring like the pros?Join Splunk’s Growth Engineering team for an ...

Wrapping Up Cybersecurity Awareness Month

October might be wrapping up, but for Splunk Education, cybersecurity awareness never goes out of season. ...

🌟 From Audit Chaos to Clarity: Welcoming Audit Trail v2

🗣 You Spoke, We Listened  Audit Trail v2 wasn’t written in isolation—it was shaped by your voices.  In ...