Splunk Search

Excluding a list of IP's from the results

samble
Path Finder

I have a list of IP's in a CSV that I need to exclude from the results of a query. Below is a my query. How can I apply the lookup feature or something else to accomplish this? I would like to include all the destination IP's that I want to exclude in the CSV and display the top ten destination IP's thanks.

sourcetype="cisco:sourcefire:appliance:syslog" AccessControlRuleAction=Allow AND NOT DstIP=172.* | top limit=10 DstIP

0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Assuming your list of excluded IPs is in a lookup file called 'exclude.csv', the query would look something like this:

sourcetype="cisco:sourcefire:appliance:syslog" AccessControlRuleAction=Allow NOT [|inputlookup exclude,csv | fields ip | format] | top limit=10 DstIP

---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

Assuming your list of excluded IPs is in a lookup file called 'exclude.csv', the query would look something like this:

sourcetype="cisco:sourcefire:appliance:syslog" AccessControlRuleAction=Allow NOT [|inputlookup exclude,csv | fields ip | format] | top limit=10 DstIP

---
If this reply helps you, Karma would be appreciated.

samble
Path Finder

Thanks for your guidance. I had to make a slight change and it worked. It wanted the fields also as DstIP

sourcetype="cisco:sourcefire:appliance:syslog" AccessControlRuleAction=Allow NOT [|inputlookup Exclude.csv | fields DstIP | format] | top limit=10 DstIP

0 Karma
Get Updates on the Splunk Community!

Automatic Discovery Part 1: What is Automatic Discovery in Splunk Observability Cloud ...

If you’ve ever deployed a new database cluster, spun up a caching layer, or added a load balancer, you know it ...

Real-Time Fraud Detection: How Splunk Dashboards Protect Financial Institutions

Financial fraud isn't slowing down. If anything, it's getting more sophisticated. Account takeovers, credit ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...