Splunk Search

Custom lookup table used in search

mpunderw
Engager

I created a csv file that has two columns, name and ip. I've uploaded the csv and I want to use the name column as list of host to search instead of doing a long list of host in the search and that way I can just update the csv to update all of my searches.

when I run something like:

index=web | lookup computers.csv name AS host

I get a ton of results from host that are not in the csv.

0 Karma

valiquet
Contributor

index=web | lookup computers.csv name AS lkhost | where host==lkhost

You can use subsearches but they have a lot of caviat
index=web NOT [| inputlookup computers.csv | table name | rename name as host ]

0 Karma

somesoni2
Revered Legend

The lookup command just enriches the existing data (adds column from lookup based on matched fields) and doesn't do any filter. You'd need to use that lookup table as subsearch filter as well to get data for only matched hosts

 index=web [| inputlookup computers.csv | table name | rename name as host ]  | ...rest of the search
0 Karma

alemarzu
Motivator

Hello there, try like this.

index=web [| inputlookup computers.csv | rename name AS host]
0 Karma
Get Updates on the Splunk Community!

See just what you’ve been missing | Observability tracks at Splunk University

Looking to sharpen your observability skills so you can better understand how to collect and analyze data from ...

Weezer at .conf25? Say it ain’t so!

Hello Splunkers, The countdown to .conf25 is on-and we've just turned up the volume! We're thrilled to ...

How SC4S Makes Suricata Logs Ingestion Simple

Network security monitoring has become increasingly critical for organizations of all sizes. Splunk has ...