Splunk Search

How to search for IP addresses in a lookup that are not found in my events?

adamsmith47
Communicator

I have a lookup which has an IP address column, and I'm trying to find which if the IP addresses from this lookup table DO NOT appear in any of my events.

I've very new to this. I've been trying several things, with no success yet.

Thanks for any replies.

0 Karma
1 Solution

somesoni2
Revered Legend

Try something like this (assuming ip_address is the field that appears in your events and ip_field is the field in lookup table)

index=foo sourcetype=bar [| inputlookup your_ip_lookup.csv | table ip_field | rename ip_field as ip_address] | stats count by ip_address | append [| inputlookup your_ip_lookup.csv | table ip_field | rename ip_field as ip_address | eval count=0 ] | stats max(count) as count by ip_address | where count=0

View solution in original post

0 Karma

somesoni2
Revered Legend

Try something like this (assuming ip_address is the field that appears in your events and ip_field is the field in lookup table)

index=foo sourcetype=bar [| inputlookup your_ip_lookup.csv | table ip_field | rename ip_field as ip_address] | stats count by ip_address | append [| inputlookup your_ip_lookup.csv | table ip_field | rename ip_field as ip_address | eval count=0 ] | stats max(count) as count by ip_address | where count=0
0 Karma

adamsmith47
Communicator

Perfect. Thank you!

0 Karma
Get Updates on the Splunk Community!

Splunk AI Assistant for SPL | Key Use Cases to Unlock the Power of SPL

Splunk AI Assistant for SPL | Key Use Cases to Unlock the Power of SPL  The Splunk AI Assistant for SPL ...

Buttercup Games: Further Dashboarding Techniques (Part 5)

This series of blogs assumes you have already completed the Splunk Enterprise Search Tutorial as it uses the ...

Customers Increasingly Choose Splunk for Observability

For the second year in a row, Splunk was recognized as a Leader in the 2024 Gartner® Magic Quadrant™ for ...