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!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...