Splunk Search

How to use a lookup csv to exclude items from a search

hartfoml
Motivator

I have a search that is looking for IDS events. I want to exclude some known src and dest IP's for count = x. So my lookup file will be like this.

src,dest,count

So how to i do the search and exclude where the items in the lookup exist in the search.

Thanks for any help....

Tags (1)

alacercogitatus
SplunkTrust
SplunkTrust

Maybe a non inclusive subsearch?

your_search_for_ids [|inputlookup your_lookup.csv append=f| fields src dest|format "NOT (" "(" "" ")" "OR" ")"]

The NOT in the format command will tell the main search to NOT use the src AND dest from the lookup. So if your lookup is:

src,dest,count
server1,server2,3
server2,server3,3

Then the subsearch evaluates to NOT ((src="server1" AND dest="server2")OR(src="server2" AND dest="server3") )

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...