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!

.conf24 | Day 0

Hello Splunk Community! My name is Chris, and I'm based in Canberra, Australia's capital, and I travelled for ...

Enhance Security Visibility with Splunk Enterprise Security 7.1 through Threat ...

(view in My Videos)Struggling with alert fatigue, lack of context, and prioritization around security ...

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...