Splunk Search

List of IP Excludes

daniel333
Builder

All,

I have a list of IP addresses which is about 40 long I don't want to include in my search. Seems silly to type NOT NOT NOT NOT 40+ times. Is there a way for me to place an array of ipaddresses and use a single NOT ?

Tags (1)

gkanapathy
Splunk Employee
Splunk Employee

Yes, use a subsearch that loads a lookup csv file:

sourcetype=things NOT [ inputlookup iplist.csv | fields ip_addr ]

The iplist.csv lookup file should contain a column called ip_addr. if the field name in your sourcetype does not match the column name in the lookup file, you can use the rename command to rename the field.

martin_mueller
SplunkTrust
SplunkTrust

Going back to laws of boolean artihmetics, not X and not Y is the same as not (X or Y) - if you just want to cut down the number of nots you can use this.

Another solution would be to tag your IPs and exclude that one tag.

0 Karma
Get Updates on the Splunk Community!

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...