<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do I extract an email address from raw data using regex? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-an-email-address-from-raw-data-using-regex/m-p/450399#M127541</link>
    <description>&lt;P&gt;Hi willymac650, &lt;BR /&gt;
try this regular expression:&lt;BR /&gt;
(("[a-zA-Z0-9_-.]+@[a-zA-Z0-9_-.]+")+),&lt;BR /&gt;
the double brackets tells it to repeat the pattern matching, I am no expert, I just googled :"find repeat patterns in regex" and one of the pages explained this, I have tried it on regex101.com with your data and I am able to match multiple times. &lt;BR /&gt;
The only problem now is that I don't know how to name each match using $&lt;BR /&gt;
Hope this helps&lt;BR /&gt;
Blaise&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 00:15:01 GMT</pubDate>
    <dc:creator>blaise</dc:creator>
    <dc:date>2020-09-30T00:15:01Z</dc:date>
    <item>
      <title>How do I extract an email address from raw data using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-an-email-address-from-raw-data-using-regex/m-p/450393#M127535</link>
      <description>&lt;P&gt;Hi all, I have some raw data looking like this.(just a part)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;....."","10/30/2018 7:31:08 AM","10/30/2018 7:41:52 AM","natalie.someone@email.com","andrew.someone@email.com","UCCAPI/3823.323.10827.* OC/16.0.10827.20150 (Skype for Business)","UCCAPI/16.0.10730.2342342 OC/16.0.10730.20088 (Skype for Business)","","","","****-5042-5F76-A879-***7","","","","","200","[IM]","{""RequestType"":""BYE"",""RequestTime"":""2018-10-30T07:41:52.2147589"",""ContentType"":"""",""ResponseCode"":""200"",..
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to extract two email addresses from each raw event (  &lt;CODE&gt;natalie.someone@email.com&lt;/CODE&gt; , &lt;CODE&gt;andrew.someone@email.com&lt;/CODE&gt; in this case) to be my two fields &lt;STRONG&gt;caller_email&lt;/STRONG&gt; and &lt;STRONG&gt;receiver_email&lt;/STRONG&gt;. &lt;/P&gt;

&lt;P&gt;Does anyone know to do this? Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Wed, 31 Oct 2018 06:40:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-an-email-address-from-raw-data-using-regex/m-p/450393#M127535</guid>
      <dc:creator>dannili</dc:creator>
      <dc:date>2018-10-31T06:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract an email address from raw data using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-an-email-address-from-raw-data-using-regex/m-p/450394#M127536</link>
      <description>&lt;P&gt;I have tried it on regex101.com and I think this will help you:&lt;/P&gt;

&lt;P&gt;\s+[.]{5}"",".+?",".+?",(?".+?"),(?".+?"),&lt;/P&gt;

&lt;P&gt;it extracts both emails and creates two fields called "email1" and "email2" to contain the result of the match.&lt;/P&gt;

&lt;P&gt;\s+  one or more space&lt;BR /&gt;
[.]{5}  5 dots&lt;BR /&gt;
"",       2 double quotes characters, followed by a coma&lt;BR /&gt;
".+?"   2 double quotes with anything inside, the ? is to make the match small (greedy?)&lt;BR /&gt;
,          a coma&lt;BR /&gt;
".+?",   same as above again&lt;BR /&gt;
(?".+?")         same as above but this time it has parentheses around, so that says that it needs to be saved, by default it would be saved into $1, but the ? part is actually naming the variable into which the matching part will be saved&lt;BR /&gt;
,           a coma&lt;BR /&gt;
(?".+?")   same as above but this time the variable is called email2&lt;BR /&gt;
,             a coma&lt;/P&gt;

&lt;P&gt;Hope this helps&lt;BR /&gt;
Blaise&lt;/P&gt;</description>
      <pubDate>Wed, 31 Oct 2018 08:19:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-an-email-address-from-raw-data-using-regex/m-p/450394#M127536</guid>
      <dc:creator>blaise</dc:creator>
      <dc:date>2018-10-31T08:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract an email address from raw data using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-an-email-address-from-raw-data-using-regex/m-p/450395#M127537</link>
      <description>&lt;P&gt;Try this regex: &lt;CODE&gt;\"(?&amp;lt;caller&amp;gt;[a-zA-Z0-9_\-\.]+@[a-zA-Z0-9_\-\.]+\.[a-zA-Z]{2,5})\",\"(?&amp;lt;receiver&amp;gt;[a-zA-Z0-9_\-\.]+@[a-zA-Z0-9_\-\.]+\.[a-zA-Z]{2,5})\"&lt;/CODE&gt;&lt;BR /&gt;
&lt;A href="https://regex101.com/r/wsaYMy/1/"&gt;https://regex101.com/r/wsaYMy/1/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;But might be worth investing some time in defining a proper delims based extraction for the entire event.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Oct 2018 08:32:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-an-email-address-from-raw-data-using-regex/m-p/450395#M127537</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-10-31T08:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract an email address from raw data using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-an-email-address-from-raw-data-using-regex/m-p/450396#M127538</link>
      <description>&lt;P&gt;This worked perfectly, thanks a lot! also suggestion noted.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Oct 2018 08:42:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-an-email-address-from-raw-data-using-regex/m-p/450396#M127538</guid>
      <dc:creator>dannili</dc:creator>
      <dc:date>2018-10-31T08:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract an email address from raw data using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-an-email-address-from-raw-data-using-regex/m-p/450397#M127539</link>
      <description>&lt;P&gt;He is only showing a fragment of his log, so &lt;CODE&gt;\s+[.]{5}&lt;/CODE&gt; is not what it actually shows at the start of his data. That's why for my answer I just created a regex that looks for 2 consecutive valid email addresses.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Oct 2018 12:09:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-an-email-address-from-raw-data-using-regex/m-p/450397#M127539</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-10-31T12:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract an email address from raw data using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-an-email-address-from-raw-data-using-regex/m-p/450398#M127540</link>
      <description>&lt;P&gt;I have a very similar question although I could have one, two or three email addresses in the raw data.  If I use the answer below I can get results if there are exactly two email addresses .... if I modify with another duplicate regex I can get results if there are exactly three email addresses.  Is there a way to get results no matter how many email addresses appear in raw data?&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2019 00:37:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-an-email-address-from-raw-data-using-regex/m-p/450398#M127540</guid>
      <dc:creator>willymac650</dc:creator>
      <dc:date>2019-04-26T00:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract an email address from raw data using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-an-email-address-from-raw-data-using-regex/m-p/450399#M127541</link>
      <description>&lt;P&gt;Hi willymac650, &lt;BR /&gt;
try this regular expression:&lt;BR /&gt;
(("[a-zA-Z0-9_-.]+@[a-zA-Z0-9_-.]+")+),&lt;BR /&gt;
the double brackets tells it to repeat the pattern matching, I am no expert, I just googled :"find repeat patterns in regex" and one of the pages explained this, I have tried it on regex101.com with your data and I am able to match multiple times. &lt;BR /&gt;
The only problem now is that I don't know how to name each match using $&lt;BR /&gt;
Hope this helps&lt;BR /&gt;
Blaise&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:15:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-an-email-address-from-raw-data-using-regex/m-p/450399#M127541</guid>
      <dc:creator>blaise</dc:creator>
      <dc:date>2020-09-30T00:15:01Z</dc:date>
    </item>
  </channel>
</rss>

