Splunk Search

Check if domain is found in local lookup file containing over 10 000 entries

licroBI_0x1
Explorer

Hi all,

I been working on new rule and I just can't get it work fully. I know that there are many similar questions/answers on the forum related to this but none of them work for me.

The events contain field "TargetUserOrGroupName" containing an email address e.g. 

 

TargetUserOrGroupName = testmail@gmail.com

 


I use split and mvindex to get only email domain out of TargetUserOrGroupName:

 

| eval email_domain = mvindex(split(TargetUserOrGroupName, "@"),1)

 

 
Then I want to check if "email_domain" is in lookup "free_email_domains.csv"

I was able to get this easily working (partial) with sub search and inputlookup

 

| search email_domain=* [|inputlookup free_email_domains.csv.csv | fields email_domain]


But there is issue with getting all data as sub-search returns only 10 000 entries resulting in free email domains not being in first 10k rows are not matched.

The local csv file contains only column email_domains (i did added "is_free_domain" column with value "Yes" in lookup while testing but it can be removed if not needed)

Any help is welcome as I cant get lookup command to work (maybe due to additional extracting of field value)

 

Labels (2)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

To determine if a given field value is in a lookup file, use the lookup command.

 

| eval email_domain = mvindex(split(TargetUserOrGroupName, "@"),1)
| lookup free_email_domains.csv.csv email_domain OUTPUT is_free_domain
``` If email_domain is not in the lookup file then is_free_domain will be null ```
| where isnotnull(is_free_domain)

 

---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

To determine if a given field value is in a lookup file, use the lookup command.

 

| eval email_domain = mvindex(split(TargetUserOrGroupName, "@"),1)
| lookup free_email_domains.csv.csv email_domain OUTPUT is_free_domain
``` If email_domain is not in the lookup file then is_free_domain will be null ```
| where isnotnull(is_free_domain)

 

---
If this reply helps you, Karma would be appreciated.

licroBI_0x1
Explorer

Hi richgalloway,

Thank you for reply, I did try as you suggested with lookup command and it didn't work but....

Because of you response I went and tried it again, this time utilizing lower() option and finding it work 🙂 

Thank you for help 💪

Get Updates on the Splunk Community!

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...