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!

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...

Cloud Monitoring Console - Unlocking Greater Visibility in SVC Usage Reporting

For Splunk Cloud customers, understanding and optimizing Splunk Virtual Compute (SVC) usage and resource ...

Automatic Discovery Part 3: Practical Use Cases

If you’ve enabled Automatic Discovery in your install of the Splunk Distribution of the OpenTelemetry ...