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!

Exporting Splunk Apps

Join us on Monday, October 21 at 11 am PT | 2 pm ET!With the app export functionality, app developers and ...

Cisco Use Cases, ITSI Best Practices, and More New Articles from Splunk Lantern

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Build Your First SPL2 App!

Watch the recording now!.Do you want to SPL™, too? SPL2, Splunk's next-generation data search and preparation ...