<?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: Anonymize only some Email Addresses in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Anonymize-only-some-Email-Addresses/m-p/215444#M63155</link>
    <description>&lt;P&gt;Thanks guys!&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jun 2016 06:46:30 GMT</pubDate>
    <dc:creator>SirHill17</dc:creator>
    <dc:date>2016-06-22T06:46:30Z</dc:date>
    <item>
      <title>Anonymize only some Email Addresses</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Anonymize-only-some-Email-Addresses/m-p/215435#M63146</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I need help writing a regex which must anonymize email address which doesn't below to the company domain. I already did some tests but with no success. Please find below the regex I tried:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;^(.*)(?:(?&amp;lt;!\S)(\w[\w\-\.]+@domain.com))(.*)$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So the aim of the regex is to have all the email addresses external of the company anonymized and keep in clear text the internal email addresses.&lt;/P&gt;

&lt;P&gt;Can someone help with that?&lt;/P&gt;

&lt;P&gt;Thanks!!!&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2016 14:16:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Anonymize-only-some-Email-Addresses/m-p/215435#M63146</guid>
      <dc:creator>SirHill17</dc:creator>
      <dc:date>2016-06-21T14:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: Anonymize only some Email Addresses</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Anonymize-only-some-Email-Addresses/m-p/215436#M63147</link>
      <description>&lt;P&gt;See if this works&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[^@]+@(?!internaldomain)(?&amp;lt;e&amp;gt;.*)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Jun 2016 14:41:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Anonymize-only-some-Email-Addresses/m-p/215436#M63147</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-06-21T14:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: Anonymize only some Email Addresses</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Anonymize-only-some-Email-Addresses/m-p/215437#M63148</link>
      <description>&lt;P&gt;Will you do this with inline search or on ingestion?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2016 14:51:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Anonymize-only-some-Email-Addresses/m-p/215437#M63148</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-06-21T14:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: Anonymize only some Email Addresses</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Anonymize-only-some-Email-Addresses/m-p/215438#M63149</link>
      <description>&lt;P&gt;I will setup that in transforms.conf and props.conf&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2016 14:55:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Anonymize-only-some-Email-Addresses/m-p/215438#M63149</guid>
      <dc:creator>SirHill17</dc:creator>
      <dc:date>2016-06-21T14:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: Anonymize only some Email Addresses</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Anonymize-only-some-Email-Addresses/m-p/215439#M63150</link>
      <description>&lt;P&gt;Since you'll use props, i recommend this multi step approach:&lt;/P&gt;

&lt;P&gt;1st change the format of the company domain,  2nd redact every email address that matches standard email format, then change company domain back to correct format:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[sourcetype]
SEDCMD-aaa=s/@company\.org/ at company.org/g
SEDCMD-bbb=s/(\w+)@(\w+)/****@\2/g
SEDCMD-ccc=s/ at /@/g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You'll note my regex in SEDCMD-bbb is not perfect for email matching, but puts you on the right track.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/1481i3CD32630D7AC4088/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2016 15:00:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Anonymize-only-some-Email-Addresses/m-p/215439#M63150</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-06-21T15:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: Anonymize only some Email Addresses</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Anonymize-only-some-Email-Addresses/m-p/215440#M63151</link>
      <description>&lt;P&gt;This pages walks you through everything except building the RegEx:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0/Data/Anonymizedatausingconfigurationfiles"&gt;http://docs.splunk.com/Documentation/Splunk/5.0/Data/Anonymizedatausingconfigurationfiles&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Try this for a RegEx:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[A-z0-9._%+-]+@[A-z0-9.-]+\.[A-z]{2,63}(?&amp;lt;!@YourCompanyDomainHere.com)(?:[^A-z]|$)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will match all email addresses EXCEPT for those matching &lt;CODE&gt;anyuser@YourCompanyDomainHere.com&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2016 15:11:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Anonymize-only-some-Email-Addresses/m-p/215440#M63151</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-06-21T15:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: Anonymize only some Email Addresses</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Anonymize-only-some-Email-Addresses/m-p/215441#M63152</link>
      <description>&lt;P&gt;Works fine!! Awesome!&lt;/P&gt;

&lt;P&gt;Would you know how to do to use it for multiple domain names?&lt;/P&gt;

&lt;P&gt;I tried with two SECCMD but doesn't work as the second one overwrites the first one.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2016 16:25:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Anonymize-only-some-Email-Addresses/m-p/215441#M63152</guid>
      <dc:creator>SirHill17</dc:creator>
      <dc:date>2016-06-21T16:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Anonymize only some Email Addresses</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Anonymize-only-some-Email-Addresses/m-p/215442#M63153</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [A-z0-9._%+-]+@[A-z0-9.-]+\.[A-z]{2,63}(?&amp;lt;!@(?:YourCompanyDomainHere.com|OtherCompany.org|AndOnAndOn.etc))(?:[^A-z]|$)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Jun 2016 16:33:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Anonymize-only-some-Email-Addresses/m-p/215442#M63153</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-06-21T16:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: Anonymize only some Email Addresses</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Anonymize-only-some-Email-Addresses/m-p/215443#M63154</link>
      <description>&lt;P&gt;The answer I gave would work fine with multiple domains but I like woodcocks regex.  So try adding an or "|"&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2016 16:35:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Anonymize-only-some-Email-Addresses/m-p/215443#M63154</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-06-21T16:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: Anonymize only some Email Addresses</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Anonymize-only-some-Email-Addresses/m-p/215444#M63155</link>
      <description>&lt;P&gt;Thanks guys!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 06:46:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Anonymize-only-some-Email-Addresses/m-p/215444#M63155</guid>
      <dc:creator>SirHill17</dc:creator>
      <dc:date>2016-06-22T06:46:30Z</dc:date>
    </item>
    <item>
      <title>Re: Anonymize only some Email Addresses</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Anonymize-only-some-Email-Addresses/m-p/215445#M63156</link>
      <description>&lt;P&gt;I also tested your solution, works fine as well. Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2016 07:44:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Anonymize-only-some-Email-Addresses/m-p/215445#M63156</guid>
      <dc:creator>SirHill17</dc:creator>
      <dc:date>2016-06-23T07:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: Anonymize only some Email Addresses</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Anonymize-only-some-Email-Addresses/m-p/215446#M63157</link>
      <description>&lt;P&gt;I gave regex hell and couldn't make it work for nothing.  Woodcocks regex works in my limited testing but I was also able to find an "all inclusive" email address detecting regex that was over 4000 characters long.  So i don't believe there is a perfect one-liner regex for this problem &amp;amp; would recommend the multi step approach instead.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Jun 2016 14:06:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Anonymize-only-some-Email-Addresses/m-p/215446#M63157</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-06-25T14:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: Anonymize only some Email Addresses</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Anonymize-only-some-Email-Addresses/m-p/215447#M63158</link>
      <description>&lt;P&gt;Yes, RegEx for email is complicated.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Jun 2016 15:06:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Anonymize-only-some-Email-Addresses/m-p/215447#M63158</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-06-25T15:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: Anonymize only some Email Addresses</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Anonymize-only-some-Email-Addresses/m-p/215448#M63159</link>
      <description>&lt;P&gt;I'm still amazed with what you crafted there!&lt;/P&gt;</description>
      <pubDate>Sat, 25 Jun 2016 15:42:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Anonymize-only-some-Email-Addresses/m-p/215448#M63159</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-06-25T15:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: Anonymize only some Email Addresses</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Anonymize-only-some-Email-Addresses/m-p/215449#M63160</link>
      <description>&lt;P&gt;It is all in the negative look-behind.  RegEx is powerful, for sure.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Jun 2016 15:45:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Anonymize-only-some-Email-Addresses/m-p/215449#M63160</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-06-25T15:45:40Z</dc:date>
    </item>
  </channel>
</rss>

