Splunk Search

IP FILTER Range

mohdameen81
Observer

HI 

 

please tell me how to write the query for the range of the IP ADDRESS Such as

src!=10.0.0.0/8 To src!=10.24.1.3

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

convert src to a number e.g. A.B.C.D => (A*256*256*256)+(B*256*256)+(C*256)+D and filter by equivalent numbers for your ip range

0 Karma

ashvinpandey
Contributor

@mohdameen81 

The following example uses the cidrmatch function as a filter to remove events that do not match the ip address:

| where cidrmatch("10.0.0.0/8", src)


Also you can use the below command as well if the above one is not working:

| search src>="10.0.0.0/8" src<="10.24.1.3"
Also, If this reply helps you, an upvote would be appreciated.
0 Karma
Get Updates on the Splunk Community!

.conf24 | Day 0

Hello Splunk Community! My name is Chris, and I'm based in Canberra, Australia's capital, and I travelled for ...

Enhance Security Visibility with Splunk Enterprise Security 7.1 through Threat ...

(view in My Videos)Struggling with alert fatigue, lack of context, and prioritization around security ...

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...