<?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: Not able to mask JSON before/at the time of indexing in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-mask-JSON-before-at-the-time-of-indexing/m-p/423484#M74366</link>
    <description>&lt;P&gt;Given that the SEDCMD works, the config must be on his indexers already.&lt;/P&gt;

&lt;P&gt;Could it be that the "indexed extractions" take place before the SEDCMD? Solution may be to define a specific TRANSFORMS with the password field as SOURCE_KEY and DEST_KEY and then apply the masking again.&lt;/P&gt;

&lt;P&gt;Edit: Oh, and shoot the person who thought it was a good idea to write plaintext passwords to a log in the first place &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 19:43:36 GMT</pubDate>
    <dc:creator>FrankVl</dc:creator>
    <dc:date>2020-09-29T19:43:36Z</dc:date>
    <item>
      <title>Not able to mask JSON before/at the time of indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-mask-JSON-before-at-the-time-of-indexing/m-p/423482#M74364</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have json data to be parsed and there is a field "password" which needs to be masked at index time. Following the wiki page &lt;A href="https://wiki.splunk.com/Community:How_to_mask_strings_in_json_event_at_Indexing_time_when_using_INDEXED_EXTRACTION" target="_blank"&gt;https://wiki.splunk.com/Community:How_to_mask_strings_in_json_event_at_Indexing_time_when_using_INDEXED_EXTRACTION&lt;/A&gt; I am able to mask the _raw but the field still shows plain text.&lt;/P&gt;

&lt;P&gt;Here's is my props and transforms and screenshot from search head:&lt;/P&gt;

&lt;P&gt;** props.conf **&lt;BR /&gt;
test_json_passwordINDEXED_EXTRACTIONS = json&lt;BR /&gt;
TIMESTAMP_FIELDS = @timestamp&lt;BR /&gt;
SEDCMD-mask_password_raw = s/\S+( - password)/"######\1/&lt;BR /&gt;
TRANSFORMS-mask_json_password = mask_json_password_meta&lt;BR /&gt;
KV_MODE = none&lt;BR /&gt;
category = Structured&lt;BR /&gt;
description = JavaScript Object Notation format. For more information, visit &lt;A href="http://json.org/" target="_blank"&gt;http://json.org/&lt;/A&gt;&lt;BR /&gt;
disabled = false&lt;BR /&gt;
pulldown_type = true&lt;/P&gt;

&lt;P&gt;** transforms.conf **&lt;BR /&gt;
[mask_json_password_meta]&lt;BR /&gt;
SOURCE_KEY = _meta&lt;BR /&gt;
DEST_KEY = _meta&lt;BR /&gt;
REGEX = ^(.&lt;EM&gt;message[tT]ext::)\S+ - password" (.&lt;/EM&gt;)&lt;BR /&gt;
FORMAT = $1"###### - password" $2&lt;BR /&gt;
WRITE_META = false&lt;/P&gt;

&lt;P&gt;** Sample Data **&lt;BR /&gt;
{&lt;BR /&gt;
   "username" : "my_username",&lt;BR /&gt;
   "password" : "my_password - password",&lt;BR /&gt;
   "validation-factors" : {&lt;BR /&gt;
      "validationFactors" : [&lt;BR /&gt;
         {&lt;BR /&gt;
            "name" : "remote_address",&lt;BR /&gt;
            "value" : "127.0.0.1"&lt;BR /&gt;
         }&lt;BR /&gt;
      ]&lt;BR /&gt;
   },&lt;BR /&gt;
   "@timestamp": "2018-01-05T14:56:29.000Z",&lt;BR /&gt;
   "attributes": {&lt;BR /&gt;
      "field_1": "value_1",&lt;BR /&gt;
      "field_2": "value_2",&lt;BR /&gt;
      "field_3": "value_3"&lt;BR /&gt;
   }&lt;BR /&gt;
}&lt;BR /&gt;
1) Masked data in raw event&lt;BR /&gt;
&lt;IMG src="https://community.splunk.com/storage/temp/250816-capture.png" alt="alt text" /&gt;&lt;BR /&gt;
2) Clear password visible in password field&lt;BR /&gt;
&lt;IMG src="https://community.splunk.com/storage/temp/250817-capture2.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:43:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-mask-JSON-before-at-the-time-of-indexing/m-p/423482#M74364</guid>
      <dc:creator>meenal901</dc:creator>
      <dc:date>2020-09-29T19:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to mask JSON before/at the time of indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-mask-JSON-before-at-the-time-of-indexing/m-p/423483#M74365</link>
      <description>&lt;P&gt;You can't do it on the search head. Your &lt;CODE&gt;props.conf&lt;/CODE&gt; and &lt;CODE&gt;transforms.conf&lt;/CODE&gt; must be on the indexers for this to work. It should be possible to do this with only the props file.&lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2018 11:30:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-mask-JSON-before-at-the-time-of-indexing/m-p/423483#M74365</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2018-05-30T11:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to mask JSON before/at the time of indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-mask-JSON-before-at-the-time-of-indexing/m-p/423484#M74366</link>
      <description>&lt;P&gt;Given that the SEDCMD works, the config must be on his indexers already.&lt;/P&gt;

&lt;P&gt;Could it be that the "indexed extractions" take place before the SEDCMD? Solution may be to define a specific TRANSFORMS with the password field as SOURCE_KEY and DEST_KEY and then apply the masking again.&lt;/P&gt;

&lt;P&gt;Edit: Oh, and shoot the person who thought it was a good idea to write plaintext passwords to a log in the first place &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:43:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-mask-JSON-before-at-the-time-of-indexing/m-p/423484#M74366</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2020-09-29T19:43:36Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to mask JSON before/at the time of indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-mask-JSON-before-at-the-time-of-indexing/m-p/423485#M74367</link>
      <description>&lt;P&gt;Oh I wish I could &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;I will try the SOURCE_KEY and DEST_KEY as password and try again.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:43:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-mask-JSON-before-at-the-time-of-indexing/m-p/423485#M74367</guid>
      <dc:creator>meenal901</dc:creator>
      <dc:date>2020-09-29T19:43:41Z</dc:date>
    </item>
  </channel>
</rss>

