Splunk Search

Using 2 lookup tables in one search?

bcusick
Communicator

Hi, trying to use two lookup tables in one search. Is this possible?

Basically I have a list of email domains in one lookup table, and a list of users in another. I want to produce a report (with my email data that has both user/email domain fields) for these certain users sending mail to these certain domains. Is there any specific syntax I need to use? Won't see to work.

source=emailRecords, lookup tables are emailDomains.csv and leavers.csv

One thing to note is that I'm using wildcards in my emailDomains.csv....so the field "ToAddress" can look like

*gmail.com,
*yahoo.com, etc.
0 Karma
1 Solution

somesoni2
SplunkTrust
SplunkTrust

I believe something like this should work. For wildcard to work on the lookup table, you need to create lookup definitions and set it to work with wildcard (see this)

source=emailRecords | lookup ludef_emailDomains emailDomain as ToAddress | lookup ludef leavers.csv userName as <<userName field in your logs>>

Updated field names as per your data.

View solution in original post

somesoni2
SplunkTrust
SplunkTrust

I believe something like this should work. For wildcard to work on the lookup table, you need to create lookup definitions and set it to work with wildcard (see this)

source=emailRecords | lookup ludef_emailDomains emailDomain as ToAddress | lookup ludef leavers.csv userName as <<userName field in your logs>>

Updated field names as per your data.

somesoni2
SplunkTrust
SplunkTrust

You might want to add some sample log entries,format of your lookup files etc. Adding more details will help you get more accurate suggestions.

0 Karma

bcusick
Communicator

This is close...but I'm looking to show only these fields. If I use inputlookup, this works. But I need (if toAddress, bccAddress, or ccAddress) is in the lookup table, return the results. I can do this for one field (inputlookup Emaildomains | fields + toAddress)...but I want it to be any of the three fields

0 Karma
Get Updates on the Splunk Community!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...