Splunk Search

regex to extract multiple email addresses in splunk search

pavanae
Builder

How to list out all the email addresses in a splunk search which displays the following results.

Storing shipConfirm email for abcabac123@msn.com
Storing shipConfirm email for lkgjdlgfk@hotmail.co.uk
Storing shipConfirm email for def.t.khv@gmail.co
and so on

0 Karma
1 Solution

somesoni2
Revered Legend

Try something like this

Your current search giving above output | rex field=YourFieldContainingEmailAddressLine max_match=0 "(?<email>[\w\d\.\-]+\@[\w\d\.]+)" 

View solution in original post

mkretsch
New Member

I will suggest slightly improved version to cover some rare naming cases

(?<email>[\w\d\.\-\_]+\@[\w\d\.\-\_]+\.[\w\d]+)
0 Karma

somesoni2
Revered Legend

Try something like this

Your current search giving above output | rex field=YourFieldContainingEmailAddressLine max_match=0 "(?<email>[\w\d\.\-]+\@[\w\d\.]+)" 

pavanae
Builder

Thanks it worked

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...