Splunk Search

How to compare contents of one lookup to another?

atebysandwich
Path Finder

Currently I have an inputlookup csv that contains a list of IP addresses and lookup csv that has a list of subnets. I would like to create a query that shows the IPs in the inputlookup table that are not part of the subnets specified in the lookup. I am stumped on how to do this any instance would be greatly appreciated. 

Labels (4)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

There is no difference between an "inputlookup csv" and a "lookup csv".  They're both CSVs.  Inputlookup and lookup are just two methods for accessing those files.

Create a lookup definition (Settings->Lookups->Lookup definitions) that references the subnets CSV.  In the Advanced settings, put CIDR(subnet) in the Match type box. (Replace "subnet" with the actual name of the subnet field.)

Now you can search for all of the entries in the addresses CSV that don't have a match in the subnets CSV.

| inputlookup addresses.csv
| lookup subnets address AS subnet OUTPUT subnet AS match
| where isnull(match)
---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...