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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...