<?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: In the following string of data, how do you mask what follows the characters &amp;quot;cpf&amp;quot;? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/In-the-following-string-of-data-how-do-you-mask-what-follows-the/m-p/416469#M95871</link>
    <description>&lt;P&gt;Your stanza header is wrong; remove the &lt;CODE&gt;sourcetype::&lt;/CODE&gt; as indicated in my updated answer.&lt;/P&gt;</description>
    <pubDate>Sun, 09 Dec 2018 00:32:44 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2018-12-09T00:32:44Z</dc:date>
    <item>
      <title>In the following string of data, how do you mask what follows the characters "cpf"?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/In-the-following-string-of-data-how-do-you-mask-what-follows-the/m-p/416457#M95859</link>
      <description>&lt;P&gt;I hava a log on a Windows server like this: D:\SplunkTest\confidencial.log and on this log, I have data like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;nome:user1,cpf:32861123800
nome:user1,cpf:32861123822
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and I would like to mask all data after "cpf=" with XXXXX, so I configure /opt/splunk/etc/system/local/props.conf with script below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::D:\\SplunkTest\\confidencial.log]

TRANSFORMS-anonymize = cpf-anonymize
root@LXPNHHSPLUNK01:/opt/splunk/etc/system/local#
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and configure /opt/splunk/etc/system/local/transforms.conf with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[cpf-anonymize]
REGEX = (?m)^(.*)cpf=\w+(\w{4}[&amp;amp;"].*)$
DEST_KEY = _raw
FORMAT = $1cpf=###########$2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, after doing this configuration, I write in the log and nothing is masked. Could someone help me and point out where I'm going wrong?&lt;/P&gt;

&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2018 19:01:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/In-the-following-string-of-data-how-do-you-mask-what-follows-the/m-p/416457#M95859</guid>
      <dc:creator>justodaniel</dc:creator>
      <dc:date>2018-11-30T19:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: In the following string of data, how do you mask what follows the characters "cpf"?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/In-the-following-string-of-data-how-do-you-mask-what-follows-the/m-p/416458#M95860</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;your regex does not look like it is written for you raw data? Moreover you might want to put that into an extra app and not into &lt;CODE&gt;system/local&lt;/CODE&gt;. &lt;/P&gt;

&lt;P&gt;Maybe something like this might go into your intended direction:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;props.conf:
[source::D:\\SplunkTest\\confidencial.log]
TRANSFORMS-anonymize = cpf-anonymizer

transforms.conf:
[cpf-anonymizer]
REGEX = ^(.+?),cpf:.*$
FORMAT = $1,cpf:###########
DEST_KEY = _raw
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Edit: simplified regex, added &lt;CODE&gt;props.conf&lt;/CODE&gt; and removed single quotes as mentioned by @ddrillic, thanks.&lt;/P&gt;

&lt;P&gt;This will take everything after &lt;CODE&gt;,cpf:&lt;/CODE&gt; until the end of the event and replace it by &lt;CODE&gt;###########&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Hope that helps.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2018 19:49:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/In-the-following-string-of-data-how-do-you-mask-what-follows-the/m-p/416458#M95860</guid>
      <dc:creator>bjoernjensen</dc:creator>
      <dc:date>2018-11-30T19:49:18Z</dc:date>
    </item>
    <item>
      <title>Re: In the following string of data, how do you mask what follows the characters "cpf"?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/In-the-following-string-of-data-how-do-you-mask-what-follows-the/m-p/416459#M95861</link>
      <description>&lt;P&gt;Hi @bjoernjensen,&lt;/P&gt;

&lt;P&gt;Thanks for your help but I think that I still make something wrong. Look my files:&lt;/P&gt;

&lt;P&gt;/opt/splunk/etc/system/local# cat props.conf&lt;BR /&gt;
[source:D:\SplunkTest\confidencial.log]&lt;BR /&gt;
TRANSFORMS-anonymize = cpf-anonymizer&lt;BR /&gt;
/opt/splunk/etc/system/local# cat transforms.conf&lt;BR /&gt;
[cpf-anonymizer]&lt;BR /&gt;
REGEX = '^(.+)(,cpf:)(.+)$'&lt;BR /&gt;
FORMAT = $1$2###########&lt;BR /&gt;
DEST_KEY = _raw&lt;BR /&gt;
/opt/splunk/etc/system/local#&lt;/P&gt;

&lt;P&gt;Could you help me?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 14:01:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/In-the-following-string-of-data-how-do-you-mask-what-follows-the/m-p/416459#M95861</guid>
      <dc:creator>justodaniel</dc:creator>
      <dc:date>2018-12-03T14:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: In the following string of data, how do you mask what follows the characters "cpf"?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/In-the-following-string-of-data-how-do-you-mask-what-follows-the/m-p/416460#M95862</link>
      <description>&lt;P&gt;I believe it should read &lt;CODE&gt;REGEX = ^(.+)(,cpf:)(.+)$&lt;/CODE&gt;, meaning, no single quotes... &lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 14:33:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/In-the-following-string-of-data-how-do-you-mask-what-follows-the/m-p/416460#M95862</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2018-12-03T14:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: In the following string of data, how do you mask what follows the characters "cpf"?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/In-the-following-string-of-data-how-do-you-mask-what-follows-the/m-p/416461#M95863</link>
      <description>&lt;P&gt;Not yet. Do I need to restart the service for the change to start working?&lt;BR /&gt;
See the files:&lt;/P&gt;

&lt;P&gt;/opt/splunk/etc/system/local# cat transforms.conf&lt;BR /&gt;
[cpf-anonymizer]&lt;BR /&gt;
REGEX = ^(.+)(,cpf:)(.+)$&lt;BR /&gt;
FORMAT = $1$2###########&lt;BR /&gt;
DEST_KEY = _raw&lt;/P&gt;

&lt;P&gt;/opt/splunk/etc/system/local# cat props.conf&lt;BR /&gt;
[source:D:\SplunkTest\confidencial.log]&lt;BR /&gt;
TRANSFORMS-anonymize = cpf-anonymizer&lt;BR /&gt;
/opt/splunk/etc/system/local#&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 16:12:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/In-the-following-string-of-data-how-do-you-mask-what-follows-the/m-p/416461#M95863</guid>
      <dc:creator>justodaniel</dc:creator>
      <dc:date>2018-12-03T16:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: In the following string of data, how do you mask what follows the characters "cpf"?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/In-the-following-string-of-data-how-do-you-mask-what-follows-the/m-p/416462#M95864</link>
      <description>&lt;P&gt;Yes, and if you want to reindex, you have to set crcSalt ...&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/admin/Inputsconf"&gt;https://docs.splunk.com/Documentation/Splunk/latest/admin/Inputsconf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 16:26:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/In-the-following-string-of-data-how-do-you-mask-what-follows-the/m-p/416462#M95864</guid>
      <dc:creator>bjoernjensen</dc:creator>
      <dc:date>2018-12-03T16:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: In the following string of data, how do you mask what follows the characters "cpf"?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/In-the-following-string-of-data-how-do-you-mask-what-follows-the/m-p/416463#M95865</link>
      <description>&lt;P&gt;In your &lt;CODE&gt;props.conf&lt;/CODE&gt; stanza you have to type double colon (&lt;CODE&gt;::&lt;/CODE&gt;) after &lt;CODE&gt;source&lt;/CODE&gt;:&lt;BR /&gt;
&lt;CODE&gt;[source::&amp;lt;SOME_SOURCE&amp;gt;]&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 17:41:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/In-the-following-string-of-data-how-do-you-mask-what-follows-the/m-p/416463#M95865</guid>
      <dc:creator>bjoernjensen</dc:creator>
      <dc:date>2018-12-03T17:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: In the following string of data, how do you mask what follows the characters "cpf"?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/In-the-following-string-of-data-how-do-you-mask-what-follows-the/m-p/416464#M95866</link>
      <description>&lt;P&gt;Great catch @bjoernjensen  ; -) &lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 17:49:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/In-the-following-string-of-data-how-do-you-mask-what-follows-the/m-p/416464#M95866</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2018-12-03T17:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: In the following string of data, how do you mask what follows the characters "cpf"?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/In-the-following-string-of-data-how-do-you-mask-what-follows-the/m-p/416465#M95867</link>
      <description>&lt;P&gt;I followed your instructions but it still did not work even after the service restart.&lt;BR /&gt;
See conf files:&lt;/P&gt;

&lt;P&gt;/opt/splunk/etc/system/local# cat props.conf&lt;BR /&gt;
[sourcetype::confidencial-too_small]&lt;BR /&gt;
TRANSFORMS-anonymize = cpf-anonymizer&lt;/P&gt;

&lt;P&gt;/opt/splunk/etc/system/local# cat transforms.conf&lt;BR /&gt;
[cpf-anonymizer]&lt;BR /&gt;
REGEX = ^(.+)(,cpf:)(.+)$&lt;BR /&gt;
FORMAT = $1$2###########&lt;BR /&gt;
DEST_KEY = _raw&lt;BR /&gt;
/opt/splunk/etc/system/local#&lt;/P&gt;

&lt;P&gt;I changed source by sourcetype to see if there is anything related to sorce, however both one and the other do not mask the data&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 18:40:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/In-the-following-string-of-data-how-do-you-mask-what-follows-the/m-p/416465#M95867</guid>
      <dc:creator>justodaniel</dc:creator>
      <dc:date>2018-12-03T18:40:41Z</dc:date>
    </item>
    <item>
      <title>Re: In the following string of data, how do you mask what follows the characters "cpf"?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/In-the-following-string-of-data-how-do-you-mask-what-follows-the/m-p/416466#M95868</link>
      <description>&lt;P&gt;Where can I be wrong? What else could you do to solve it?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 18:46:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/In-the-following-string-of-data-how-do-you-mask-what-follows-the/m-p/416466#M95868</guid>
      <dc:creator>justodaniel</dc:creator>
      <dc:date>2018-12-03T18:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: In the following string of data, how do you mask what follows the characters "cpf"?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/In-the-following-string-of-data-how-do-you-mask-what-follows-the/m-p/416467#M95869</link>
      <description>&lt;P&gt;You are taking the long way using the old approach; keep it simple like this in props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[confidencial-too_small]
SEDCMD-cpf_anonymizer = s/,cpf:\d+/,cpf:###########/
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Deploy to the first full instance of splunk that handles the data (usually the Indexers but you might have HF) and restart all splunk instances there.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 20:40:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/In-the-following-string-of-data-how-do-you-mask-what-follows-the/m-p/416467#M95869</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-12-03T20:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: In the following string of data, how do you mask what follows the characters "cpf"?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/In-the-following-string-of-data-how-do-you-mask-what-follows-the/m-p/416468#M95870</link>
      <description>&lt;P&gt;I followed his suggestion however after having changed the props.conf restart the splunk but still did not work I write in the log file something like: "testing, cpf = 156766164343" and nothing is changed.&lt;/P&gt;

&lt;P&gt;See the file: /opt/splunk/etc/system/local# cat props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[sourcetype::confidencial-too_small]
SEDCMD-cpf_anonymizer = s/,cpf:\d+/,cpf:###########/
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Dec 2018 18:40:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/In-the-following-string-of-data-how-do-you-mask-what-follows-the/m-p/416468#M95870</guid>
      <dc:creator>justodaniel</dc:creator>
      <dc:date>2018-12-07T18:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: In the following string of data, how do you mask what follows the characters "cpf"?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/In-the-following-string-of-data-how-do-you-mask-what-follows-the/m-p/416469#M95871</link>
      <description>&lt;P&gt;Your stanza header is wrong; remove the &lt;CODE&gt;sourcetype::&lt;/CODE&gt; as indicated in my updated answer.&lt;/P&gt;</description>
      <pubDate>Sun, 09 Dec 2018 00:32:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/In-the-following-string-of-data-how-do-you-mask-what-follows-the/m-p/416469#M95871</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-12-09T00:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: In the following string of data, how do you mask what follows the characters "cpf"?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/In-the-following-string-of-data-how-do-you-mask-what-follows-the/m-p/416470#M95872</link>
      <description>&lt;P&gt;Did this work for you, @justodaniel?  Be sure to &lt;CODE&gt;UpVote&lt;/CODE&gt; any helpful answers and click &lt;CODE&gt;Accept&lt;/CODE&gt; if one worked.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Dec 2018 06:46:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/In-the-following-string-of-data-how-do-you-mask-what-follows-the/m-p/416470#M95872</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-12-10T06:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: In the following string of data, how do you mask what follows the characters "cpf"?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/In-the-following-string-of-data-how-do-you-mask-what-follows-the/m-p/416471#M95873</link>
      <description>&lt;P&gt;Sorry I had not seen the answer. I'll do what you said and I'll tell you the result here.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Dec 2018 18:13:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/In-the-following-string-of-data-how-do-you-mask-what-follows-the/m-p/416471#M95873</guid>
      <dc:creator>justodaniel</dc:creator>
      <dc:date>2018-12-27T18:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: In the following string of data, how do you mask what follows the characters "cpf"?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/In-the-following-string-of-data-how-do-you-mask-what-follows-the/m-p/416472#M95874</link>
      <description>&lt;P&gt;Thank you! worked perfectly.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Dec 2018 18:41:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/In-the-following-string-of-data-how-do-you-mask-what-follows-the/m-p/416472#M95874</guid>
      <dc:creator>justodaniel</dc:creator>
      <dc:date>2018-12-27T18:41:53Z</dc:date>
    </item>
  </channel>
</rss>

