Splunk Search

lookup table slows down the search query

splunker12er
Motivator

I have a lookup table blacklist.csv , which has blacklisted src & dest IPs. Using the below search query , I am listing the events containing blacklisted IPs

index=* sourcetype=pan* [|inputlookup blacklist.csv | fields dest_ip] OR [|inputlookup blacklist.csv | fields src_ip]  | table dest_ip,src_ip,status,etc..

My lookup table has 10,000 records, which makes my search slow down. Is there a way optimize the query ?
or any other mechanism to speed up the search ?

0 Karma

lmyrefelt
Builder

You could index the csv file into an index, that i am sure will speed up your search.

If you have a distributed environment and your lookup file is BIG , you also add local=t .

Like;

[|inputlookup local=t blacklist.csv

That helps to speed it up sometimes .

0 Karma

somesoni2
Revered Legend

See if this is faster than your current query.

index=* sourcetype=pan* [|inputlookup blacklist.csv | table dest_ip src_ip | format | format "" "" "OR" "" "OR" ""]  | table dest_ip,src_ip,status,etc..
0 Karma

splunker12er
Motivator

No there are no duplicate entries in the lookup table.
I tried dedup but it takes the same time..
For a very long time , still the search query is in parsing state.

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Are there any duplicates in the list? As a first step, add a dedup dest_ip and dedup src_ip to each.

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: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

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

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