Splunk Search

exclude multiple subnets from search

rashid47010
Communicator

I have a list of subnets that I want to exlude from search.
below isthe search
| search NOT cidrmatch("xx.xx.xx.xx/24",src) OR cidrmatch("xx.xx.xx.xx/22",src) OR cidrmatch("xx.xx.xx.xx",src) OR cidrmatch("xx.xx.xx.xx/21",src) OR cidrmatch("xx.xx.xx.xx/22",src) OR cidrmatch("xx.xx.xx.xx/24",src) OR cidrmatch("",src)

0 Karma

richgalloway
SplunkTrust
SplunkTrust

What is your question? Aside from needing parentheses around the NOT clause, the query is fine.

| search NOT (cidrmatch("xx.xx.xx.xx/24",src) OR cidrmatch("xx.xx.xx.xx/22",src) OR cidrmatch("xx.xx.xx.xx",src) OR cidrmatch("xx.xx.xx.xx/21",src) OR cidrmatch("xx.xx.xx.xx/22",src) OR cidrmatch("xx.xx.xx.xx/24",src) OR cidrmatch("",src) )
---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...