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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

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 ...