Splunk Search

How to search csv for values in a lookup table?

akke
Explorer

I have a large csv with lots of columns and a lookup table below

payload
*.exe
*.zip
*.7z

How do I search all fields for values in my lookup table? For example I want to look for values like "badfile.exe".

Tags (3)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Read the lookup file in a subsearch and use the format command to help build the main search.

index=foo [|inputlookup payload.csv | fields payload | format]

will expand into the search index=foo (payload=*.exe OR payload=*.zip OR payload=*.7z)

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...