Splunk Search

Regex search through splunk

vplunk
Explorer

Is there a method to do "AND" while writing regex instead of "OR" . As when i write a reg and add to regex _raw="expression". Since using "|" its matching a lot of similar logs . 

Labels (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

It would help to see some example data and your current query.  However, you may accomplish your goal using where instead of regex.

... | where (match(_raw, "expression") AND match(_raw, "other expression")

 

---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

It would help to see some example data and your current query.  However, you may accomplish your goal using where instead of regex.

... | where (match(_raw, "expression") AND match(_raw, "other expression")

 

---
If this reply helps you, Karma would be appreciated.

vplunk
Explorer

Thank you and it worked .. 

Tags (1)
0 Karma
Get Updates on the Splunk Community!

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...

Data Management Digest – November 2025

  Welcome to the inaugural edition of Data Management Digest! As your trusted partner in data innovation, the ...