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
Get Updates on the Splunk Community!

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...