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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...