Splunk Search

How to organize search substrings into LookUp tables?

pm771
Communicator

Hello

I have a Splunk query that looks like following:

 

index=something "*abc*" OR "*def*" OR "*hig*" 

 

These substrings do not belong to particular fields. Is there a way to put them in a lookup table?

If they were field values, I would've done something like: 

 

index=something
   [| inputlookup My.csv |  fields FieldName | format]

 

 

Labels (1)
Tags (2)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

If you put the strings in a lookup file using the field name foo then you should be able search for them using this query.

index=something
   [| inputlookup My.csv | return 1000 $foo]
---
If this reply helps you, Karma would be appreciated.

View solution in original post

Tags (1)

richgalloway
SplunkTrust
SplunkTrust

If you put the strings in a lookup file using the field name foo then you should be able search for them using this query.

index=something
   [| inputlookup My.csv | return 1000 $foo]
---
If this reply helps you, Karma would be appreciated.
Tags (1)

yuanliu
SplunkTrust
SplunkTrust

Thank you, @richgalloway!  I never learned about return command and the use of $field.

Get Updates on the Splunk Community!

Accelerating Observability as Code with the Splunk AI Assistant

We’ve seen in previous posts what Observability as Code (OaC) is and how it’s now essential for managing ...

Integrating Splunk Search API and Quarto to Create Reproducible Investigation ...

 Splunk is More Than Just the Web Console For Digital Forensics and Incident Response (DFIR) practitioners, ...

Congratulations to the 2025-2026 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...