Splunk Search

How do I remove an IP Range from a Search?

AidanMarkSmith
Observer

We currently have the user case  - High Number of Login Failures from a single source turned on

We would like to exclude some IP ranges from the search that we failover our staff to.

Our Search terms at the moment is -

index=appext_o365 `o365_management_activity` Operation=UserLoginFailed record_type=AzureActiveDirectoryStsLogon app=AzureActiveDirectory | stats count dc(user) as accounts_locked values(user) as user values(LogonError) as LogonError values(authentication_method) as authentication_method values(signature) as signature values(UserAgent) as UserAgent by src_ip record_type Operation app | search accounts_locked >= 10| `high_number_of_login_failures_from_a_single_source_filter`

I added | search src_ip!="###.##.##.17" |  which does remove that one IP, from the search but obviously I dont want to manually put in 1 to 128.

Any assistance would be very much appreciated

Labels (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @AidanMarkSmith,

as @diogofgm hinted, please try:

index=appext_o365 `o365_management_activity` Operation=UserLoginFailed record_type=AzureActiveDirectoryStsLogon app=AzureActiveDirectory NOT src_ip="192.168.1.0/24"
| stats 
   count dc(user) as accounts_locked 
   values(user) as user 
   values(LogonError) as LogonError 
   values(authentication_method) as authentication_method 
   values(signature) as signature 
   values(UserAgent) as UserAgent 
   by src_ip record_type Operation app 
| where accounts_locked > 9
| `high_number_of_login_failures_from_a_single_source_filter`

Ciao.

Giuseppe

0 Karma

AidanMarkSmith
Observer

Hi @gcusello 

index=appext_o365 `o365_management_activity` Operation=UserLoginFailed record_type=AzureActiveDirectoryStsLogon app=AzureActiveDirectory NOT src_ip="192.168.1.0/24" | stats count dc(user) as accounts_locked values(user) as user values(LogonError) as LogonError values(authentication_method) as authentication_method values(signature) as signature values(UserAgent) as UserAgent by src_ip record_type Operation app | where accounts_locked > 9 | `high_number_of_login_failures_from_a_single_source_filter`

This is still showing my IP range in the search unfortuantely.

0 Karma

diogofgm
SplunkTrust
SplunkTrust

Are you using the correct range? Also try to change the last octet from 0 t0 1

Check your network range CIDR notation in here:
https://www.ipaddressguide.com/cidr

------------
Hope I was able to help you. If so, some karma would be appreciated.
0 Karma

diogofgm
SplunkTrust
SplunkTrust

You can use CIDR notations in search.

src_ip="192.168.1.0/24"
------------
Hope I was able to help you. If so, some karma would be appreciated.
0 Karma

AidanMarkSmith
Observer

Thanks for the quick reply, I've tried that and they still appear in the search.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Tiling

This puzzle (first published here) is based on finding groups of tessellated tiles (inspired by floor tiles I ...

SOK it to Me: Top 3 Benefits of Using Splunk Operator on Kubernetes that’ll Make ...

    Thursday, July 9, 2026  |  11:00AM–12:00PM PDT Duration: 1 hour (includes Q&A) Managing can feel like a ...

Upgrade Prep for 10.4, Network Observability Deep Dives, and More from Splunk Lantern

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...