Splunk Search

input lookup

tkrprakash
Loves-to-Learn Lots

Hi All,

I have an input lookup file with 2 fields  first filed contains some path and the second filed is an httpcode for the path. 
example   :  /s/a/list   403  ; /s/b/list 504 

i need help to form a search query to exclude the fields in this input lookup file with matching the httpcode ; 

whe i run query with like

index=a and sourcetype=*b*  it needs to exclude the path and specific httpcode from the excel and siplay output for other paths and httpcodes. 

please help 

Labels (1)
Tags (1)
0 Karma

PrewinThomas
Motivator

@tkrprakash 

You can try below one,

index=a sourcetype=*b*
| lookup exclude_paths.csv path AS path httpcode AS httpcode OUTPUT path AS matched_path
| where isnull(matched_path)

Also you can try with subsearch

index=a sourcetype=*b*
NOT [ | inputlookup exclude_paths.csv | fields path httpcode ]


Regards,
Prewin
Splunk Enthusiast | Always happy to help! If this answer helped you, please consider marking it as the solution or giving a Karma. Thanks!

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @tkrprakash ,

do you want to exclude from results events that match the full paths contained in the lookup or a part of it?

if you want to use the full path and you have two extracted fileds in your results called "path" and "http_code", you could run something like this:

index=a and sourcetype=*b* NOT [ | inputlookup your_lookup.csv | fields path http_code ]
| ...

if the fields in your main search have different names, you must rename them in the subsearch to be sure to match the field names from the main search.

If instead the path in the lookup must match only a part of the path field, you should run something like this:

index=a and sourcetype=*b* NOT [ | inputlookup your_lookup.csv | rename path AS query | fields query http_code ]
| ...

 Ciao.

Giuseppe

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!

What You Read the Most in 2026: Splunk Lantern's Most Popular Articles, Top Themes, ...

Splunk Lantern is Splunk's customer success center that provides practical guidance from Splunk experts on key ...

Splunk Auto Ingestion Parallel Pipeline Scaling

Why this feature matters Many Splunk environments experience ingestion pressure long before the host is fully ...

The Data Connection - November 2026

Machine data keeps growing, and every new source brings practical questions: where should it live, how ...