Splunk Search

checking list of email domains appear in a field

ChrisCLewis
Communicator

I have a field (recipient) which contains all the recipients that an email was sent to. I also have a lookupcsv file with field (watch) which list of domain address to look for e.g. gmail.com

How can I check to see if a domain from the lookup csv appears anywhere within the recipient field - I need it as a filter so I can do work with the remainder of the records data

I have gotten closet using
|join recipient [|inputlookup check.csv |rename watch as recipient|fields recipient]

but it is not returning enough matches.

Many thanks for any pointers

Tags (1)
0 Karma
1 Solution

dkeck
Influencer

Hi,

if you have a lookup with a field watch and lets say the value of "yes" and "no", you can use the | lookup command

like this : | lookup check.csv recipient OUTPUT watch you could add | fields recipient watch (assuming the field with the domains within the check.csv is called recipient)

then you can search for the value yes within the field watch your search| lookup check.csv recipient OUTPUT watch | fields recipient watch | where watch="yes"

View solution in original post

0 Karma

dkeck
Influencer

please accept answer if it was helpful 🙂

0 Karma

tmuthuk
Path Finder

Hi

Can you try this ?

Extract Domain from the recipient field and join with the Check.csv . Try the below query

| rex field=Recipient "\@(?[^.]*)" | eval Found= "N" | table Recipient Domain | join Domain [ | inputlookup Check.csv | eval Found="Y" | table Domain Found]

0 Karma

dkeck
Influencer

Hi,

if you have a lookup with a field watch and lets say the value of "yes" and "no", you can use the | lookup command

like this : | lookup check.csv recipient OUTPUT watch you could add | fields recipient watch (assuming the field with the domains within the check.csv is called recipient)

then you can search for the value yes within the field watch your search| lookup check.csv recipient OUTPUT watch | fields recipient watch | where watch="yes"

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...