Alerting

How would I be able to exclude source_ip and destination_ip combination?

Splunk77
Explorer

I have a look up table with two columns. They are for source IP and destination IP addresses. I want to be able to search for firewall traffic logs and filter out any source IP and destination IP combination from the results.

The following query allows for excluding source_ip from the lookup table. How would I be able to exclude source_ip and destination_ip combination?

 

index=firewall sourcetype=<source_type> NOT [ | inputlookup test.csv

table source_ip] 

| table _time, source_ip, destination_ip, action, protocol 

Thanks.

Labels (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

When you read from the lookup file, include both the source and destination IP addresses.  The trick then is to use the format command to build a search string in the form (src_ip=1.2.3.4 AND dest_ip=5.6.7.8).  It's important to ensure the field names returned by the subsearch match field names available in the main search.

index=firewall sourcetype=<source_type> NOT [ | inputlookup test.csv
fields source_ip destination_ip | format maxresults=0 ] 
| table _time, source_ip, destination_ip, action, protocol 

 

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

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

When you read from the lookup file, include both the source and destination IP addresses.  The trick then is to use the format command to build a search string in the form (src_ip=1.2.3.4 AND dest_ip=5.6.7.8).  It's important to ensure the field names returned by the subsearch match field names available in the main search.

index=firewall sourcetype=<source_type> NOT [ | inputlookup test.csv
fields source_ip destination_ip | format maxresults=0 ] 
| table _time, source_ip, destination_ip, action, protocol 

 

---
If this reply helps you, Karma would be appreciated.
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 ...