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
Revered Legend

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
Revered Legend

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
Revered Legend

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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Build the Future of Agentic AI: Join the Splunk Agentic Ops Hackathon

AI is changing how teams investigate incidents, detect threats, automate workflows, and build intelligent ...

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...