<?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: strip portion of an email in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/strip-portion-of-an-email/m-p/502318#M139820</link>
    <description>&lt;P&gt;Try &lt;CODE&gt;| rex field=email mode=sed "s/-priv//"&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 20 Mar 2020 15:55:07 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2020-03-20T15:55:07Z</dc:date>
    <item>
      <title>strip portion of an email</title>
      <link>https://community.splunk.com/t5/Splunk-Search/strip-portion-of-an-email/m-p/502316#M139818</link>
      <description>&lt;P&gt;I am needing to strip a portion out of email's.  I have a list of email addresses where some of them contain -priv before the @ that I need stripped out leaving what would be the "normal" email address.&lt;/P&gt;

&lt;P&gt;example address&lt;BR /&gt;
&lt;A href="mailto:example-priv@email.com"&gt;example-priv@email.com&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I want to be left with &lt;A href="mailto:example@email.com"&gt;example@email.com&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;can someone help me with the rex for this?&lt;/P&gt;

&lt;P&gt;thank you&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2020 14:57:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/strip-portion-of-an-email/m-p/502316#M139818</guid>
      <dc:creator>brownt61</dc:creator>
      <dc:date>2020-03-20T14:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: strip portion of an email</title>
      <link>https://community.splunk.com/t5/Splunk-Search/strip-portion-of-an-email/m-p/502317#M139819</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval email="example-priv@email.com" 
| rex field=email mode=sed "s/-[^@]+@/@/g"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Mar 2020 15:54:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/strip-portion-of-an-email/m-p/502317#M139819</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2020-03-20T15:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: strip portion of an email</title>
      <link>https://community.splunk.com/t5/Splunk-Search/strip-portion-of-an-email/m-p/502318#M139820</link>
      <description>&lt;P&gt;Try &lt;CODE&gt;| rex field=email mode=sed "s/-priv//"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2020 15:55:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/strip-portion-of-an-email/m-p/502318#M139820</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-03-20T15:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: strip portion of an email</title>
      <link>https://community.splunk.com/t5/Splunk-Search/strip-portion-of-an-email/m-p/502319#M139821</link>
      <description>&lt;P&gt;Thank you,  I should add that I have since noticed that there are email addresses that have an appropriate need to have - in them.&lt;/P&gt;

&lt;P&gt;example&lt;BR /&gt;
&lt;A href="mailto:surname.givenname-middlename-priv@email.com"&gt;surname.givenname-middlename-priv@email.com&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;so I really need to only strip emails that have -priv in them, not any email that contains a - from the - to @&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2020 15:59:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/strip-portion-of-an-email/m-p/502319#M139821</guid>
      <dc:creator>brownt61</dc:creator>
      <dc:date>2020-03-20T15:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: strip portion of an email</title>
      <link>https://community.splunk.com/t5/Splunk-Search/strip-portion-of-an-email/m-p/502320#M139822</link>
      <description>&lt;P&gt;Thank you, this worked&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2020 16:03:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/strip-portion-of-an-email/m-p/502320#M139822</guid>
      <dc:creator>brownt61</dc:creator>
      <dc:date>2020-03-20T16:03:31Z</dc:date>
    </item>
  </channel>
</rss>

