<?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 How do you  anonymize two recognized fields in Splunk? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-anonymize-two-recognized-fields-in-Splunk/m-p/121063#M32548</link>
    <description>&lt;P&gt;Hello Splunkers,&lt;/P&gt;

&lt;P&gt;I am trying to follow the logic from the below URL to anonymize some field data on the fly.&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.0/Data/Anonymizedatausingconfigurationfiles"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.0/Data/Anonymizedatausingconfigurationfiles&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;The following Splunk Search query gets all the fields for my output without regex.&lt;/P&gt;

&lt;P&gt;sourcetype=ourdatasource userPassword | table index host source sourcetype authority user password userPassword&lt;/P&gt;

&lt;P&gt;The next step for me is to try and anonymize this data. &lt;BR /&gt;
Both regular expressions below are verified to work with just the rex fields below.&lt;/P&gt;

&lt;P&gt;As I write this question I am starting to wonder if I even need a REGEX statement below&lt;BR /&gt;
for these fields as they are all recognized fields in Splunk. Can someone confirm that maybe&lt;BR /&gt;
I do not need a REGEX statement.  Maybe something else? &lt;/P&gt;

&lt;P&gt;Also I am not sure about the format statement if that is the case.&lt;/P&gt;

&lt;P&gt;[ourdatasource]&lt;BR /&gt;
TRANSFORMS-anonymize = userpass-anonymizer, pass-anonymizer&lt;/P&gt;

&lt;P&gt;[userpass-anonymizer]&lt;BR /&gt;
REGEX = (?i)^(?:[^;]*;){4}(?P[^=]+)&lt;BR /&gt;
FORMAT = $1UserPassword=###$2&lt;BR /&gt;
DEST_KEY = _raw&lt;/P&gt;

&lt;P&gt;[pass-anonymizer]&lt;BR /&gt;
REGEX = (?i)&amp;amp;(?P[^=]+)&lt;BR /&gt;
FORMAT = $1password=########$2&lt;BR /&gt;
DEST_KEY = _raw&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Daniel&lt;/P&gt;</description>
    <pubDate>Wed, 12 Nov 2014 17:47:38 GMT</pubDate>
    <dc:creator>dmacgillivray</dc:creator>
    <dc:date>2014-11-12T17:47:38Z</dc:date>
    <item>
      <title>How do you  anonymize two recognized fields in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-anonymize-two-recognized-fields-in-Splunk/m-p/121063#M32548</link>
      <description>&lt;P&gt;Hello Splunkers,&lt;/P&gt;

&lt;P&gt;I am trying to follow the logic from the below URL to anonymize some field data on the fly.&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.0/Data/Anonymizedatausingconfigurationfiles"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.0/Data/Anonymizedatausingconfigurationfiles&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;The following Splunk Search query gets all the fields for my output without regex.&lt;/P&gt;

&lt;P&gt;sourcetype=ourdatasource userPassword | table index host source sourcetype authority user password userPassword&lt;/P&gt;

&lt;P&gt;The next step for me is to try and anonymize this data. &lt;BR /&gt;
Both regular expressions below are verified to work with just the rex fields below.&lt;/P&gt;

&lt;P&gt;As I write this question I am starting to wonder if I even need a REGEX statement below&lt;BR /&gt;
for these fields as they are all recognized fields in Splunk. Can someone confirm that maybe&lt;BR /&gt;
I do not need a REGEX statement.  Maybe something else? &lt;/P&gt;

&lt;P&gt;Also I am not sure about the format statement if that is the case.&lt;/P&gt;

&lt;P&gt;[ourdatasource]&lt;BR /&gt;
TRANSFORMS-anonymize = userpass-anonymizer, pass-anonymizer&lt;/P&gt;

&lt;P&gt;[userpass-anonymizer]&lt;BR /&gt;
REGEX = (?i)^(?:[^;]*;){4}(?P[^=]+)&lt;BR /&gt;
FORMAT = $1UserPassword=###$2&lt;BR /&gt;
DEST_KEY = _raw&lt;/P&gt;

&lt;P&gt;[pass-anonymizer]&lt;BR /&gt;
REGEX = (?i)&amp;amp;(?P[^=]+)&lt;BR /&gt;
FORMAT = $1password=########$2&lt;BR /&gt;
DEST_KEY = _raw&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Daniel&lt;/P&gt;</description>
      <pubDate>Wed, 12 Nov 2014 17:47:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-anonymize-two-recognized-fields-in-Splunk/m-p/121063#M32548</guid>
      <dc:creator>dmacgillivray</dc:creator>
      <dc:date>2014-11-12T17:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do you  anonymize two recognized fields in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-anonymize-two-recognized-fields-in-Splunk/m-p/121064#M32549</link>
      <description>&lt;P&gt;The URL that you pointed to refers to anonymizing the data prior to it being indexed - if you do this, the actual data will never be viewable in Splunk, just the anonymized version. This may or may not be what you want.&lt;/P&gt;

&lt;P&gt;If it is OK that only the anonymized version of the data is in Splunk, then you must anonymize it prior to it being indexed, which means you do, in fact, need the regexes. The reason is that indexing happens &lt;STRONG&gt;before&lt;/STRONG&gt; Splunk tries to break up your data into discoverable fields. Once indexing happens, the data cannot be changed, so it would be searchable in Splunk if it had not been anonymized prior.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Nov 2014 18:16:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-anonymize-two-recognized-fields-in-Splunk/m-p/121064#M32549</guid>
      <dc:creator>aweitzman</dc:creator>
      <dc:date>2014-11-12T18:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do you  anonymize two recognized fields in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-anonymize-two-recognized-fields-in-Splunk/m-p/121065#M32550</link>
      <description>&lt;P&gt;Thanks for your comments on this subject. Unfortunately I have tried this, as I have completely removed the data on my test server which is  pointing to an app location on /opt/splunk/etc/apps. &lt;/P&gt;

&lt;P&gt;Then I tried again, reloaded the data and re-queried the data with the same results. &lt;/P&gt;

&lt;P&gt;I have also moved this entire app over to /opt/splunk/etc/system/local just to see if it was a placement issue.&lt;BR /&gt;
That also did not work out.   If you can think of something else, let me know. Very interesting point you make about&lt;BR /&gt;
the regex part of my question. &lt;/P&gt;</description>
      <pubDate>Wed, 12 Nov 2014 18:42:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-anonymize-two-recognized-fields-in-Splunk/m-p/121065#M32550</guid>
      <dc:creator>dmacgillivray</dc:creator>
      <dc:date>2014-11-12T18:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: How do you  anonymize two recognized fields in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-anonymize-two-recognized-fields-in-Splunk/m-p/121066#M32551</link>
      <description>&lt;P&gt;All I can think of is that there might be an issue with your regex or FORMAT string. The primary thrust of my answer had to do with whether the regexes were necessary or not.&lt;/P&gt;

&lt;P&gt;In terms of the actual regexes and FORMAT strings, sample raw data will be necessary to help you there.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Nov 2014 19:33:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-anonymize-two-recognized-fields-in-Splunk/m-p/121066#M32551</guid>
      <dc:creator>aweitzman</dc:creator>
      <dc:date>2014-11-12T19:33:26Z</dc:date>
    </item>
  </channel>
</rss>

