<?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: Help with data masking in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-data-masking/m-p/433615#M75780</link>
    <description>&lt;P&gt;You could probably use below link to anonymize data at index time.&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/7.2.6/Data/Anonymizedata#Define_the_sed_script_in_props.conf"&gt;https://docs.splunk.com/Documentation/SplunkCloud/7.2.6/Data/Anonymizedata#Define_the_sed_script_in_props.conf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;and try &lt;CODE&gt;s/(\"firstName\":\s+\")\w+/\1xxx/g&lt;/CODE&gt; for every field. Use the same for every field just change the name in round brackets and it should work.&lt;/P&gt;

&lt;P&gt;Before this I would recommend you to try this in search time using &lt;CODE&gt;rex&lt;/CODE&gt; on your prod data to see if it actually what you want.&lt;/P&gt;

&lt;P&gt;This is sample run anywhere search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval data="\"owner\": {
\"firstName\": \"abc\",
\"middleName\": \"xyz\",
\"lastName\": \"eee\",
\"dateOfBirth\": \"1/1/2000 12:00:00 AM\",
\"ssn\": \"099999999\",
\"citizenship\": \"alien\"," | rex field=data mode=sed "s/(\"firstName\":\s+\")\w+/\1xxx/g" | rex field=data mode=sed "s/(\"middleName\":\s+\")\w+/\1xxx/g"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You should use &lt;CODE&gt;rex&lt;/CODE&gt; command given above on your prod data and see if it is actually working.&lt;/P&gt;

&lt;P&gt;Let me know if this helps!&lt;/P&gt;</description>
    <pubDate>Tue, 06 Aug 2019 16:29:11 GMT</pubDate>
    <dc:creator>mayurr98</dc:creator>
    <dc:date>2019-08-06T16:29:11Z</dc:date>
    <item>
      <title>Help with data masking</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-data-masking/m-p/433614#M75779</link>
      <description>&lt;P&gt;Below is the sample mocked up data .I want to mask the the ones's highlighted .The sample data is part of an event which is more than 300 lines&lt;/P&gt;

&lt;P&gt;"status": 1,&lt;BR /&gt;
    "parentGoalId": 5133,&lt;BR /&gt;
    "account": {&lt;BR /&gt;
      "goalId": 0,&lt;BR /&gt;
      "accountType": "regular",&lt;BR /&gt;
      "accountOpenDate": "0001-01-01T00:00:00",&lt;BR /&gt;
      "isAccountOpeningInProgress": true,&lt;BR /&gt;
      "owner": {&lt;BR /&gt;
        "&lt;STRONG&gt;firstName": "abc",&lt;BR /&gt;
        "middleName": "xyz",&lt;BR /&gt;
        "lastName": "eee",&lt;BR /&gt;
        "dateOfBirth": "1/1/2000 12:00:00 AM",&lt;BR /&gt;
        "ssn": "099999999&lt;/STRONG&gt;",&lt;BR /&gt;
        "citizenship": "alien",&lt;BR /&gt;
        "isMailingAddressAsPhysical": false,&lt;BR /&gt;
        "isTextMessageNotificationEnabled": false,&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 14:38:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-data-masking/m-p/433614#M75779</guid>
      <dc:creator>vrmandadi</dc:creator>
      <dc:date>2019-08-06T14:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: Help with data masking</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-data-masking/m-p/433615#M75780</link>
      <description>&lt;P&gt;You could probably use below link to anonymize data at index time.&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/7.2.6/Data/Anonymizedata#Define_the_sed_script_in_props.conf"&gt;https://docs.splunk.com/Documentation/SplunkCloud/7.2.6/Data/Anonymizedata#Define_the_sed_script_in_props.conf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;and try &lt;CODE&gt;s/(\"firstName\":\s+\")\w+/\1xxx/g&lt;/CODE&gt; for every field. Use the same for every field just change the name in round brackets and it should work.&lt;/P&gt;

&lt;P&gt;Before this I would recommend you to try this in search time using &lt;CODE&gt;rex&lt;/CODE&gt; on your prod data to see if it actually what you want.&lt;/P&gt;

&lt;P&gt;This is sample run anywhere search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval data="\"owner\": {
\"firstName\": \"abc\",
\"middleName\": \"xyz\",
\"lastName\": \"eee\",
\"dateOfBirth\": \"1/1/2000 12:00:00 AM\",
\"ssn\": \"099999999\",
\"citizenship\": \"alien\"," | rex field=data mode=sed "s/(\"firstName\":\s+\")\w+/\1xxx/g" | rex field=data mode=sed "s/(\"middleName\":\s+\")\w+/\1xxx/g"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You should use &lt;CODE&gt;rex&lt;/CODE&gt; command given above on your prod data and see if it is actually working.&lt;/P&gt;

&lt;P&gt;Let me know if this helps!&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 16:29:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-data-masking/m-p/433615#M75780</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2019-08-06T16:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: Help with data masking</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-data-masking/m-p/433616#M75781</link>
      <description>&lt;P&gt;Hello Mayurr,&lt;/P&gt;

&lt;P&gt;Thank you for your response I tries using the rex for date of birth s/(\"dateOfBirth\":\s+\")\w+/\1xxx/g .This only masked the part before the first / like xxx/1/2000 12:00:00 AM &lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 18:10:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-data-masking/m-p/433616#M75781</guid>
      <dc:creator>vrmandadi</dc:creator>
      <dc:date>2019-08-06T18:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: Help with data masking</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-data-masking/m-p/433617#M75782</link>
      <description>&lt;P&gt;Try this for date of birth:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| rex field=data mode=sed "s/(\"dateOfBirth\":\s+\")[^\"]+/\1xxx/g"&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;Pls accept if it works for you to close this question.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 18:24:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-data-masking/m-p/433617#M75782</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2019-08-06T18:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: Help with data masking</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-data-masking/m-p/433618#M75783</link>
      <description>&lt;P&gt;Thank You it worked&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 19:08:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-data-masking/m-p/433618#M75783</guid>
      <dc:creator>vrmandadi</dc:creator>
      <dc:date>2019-08-06T19:08:41Z</dc:date>
    </item>
  </channel>
</rss>

