<?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: Masking a data at search time in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Masking-a-data-at-search-time/m-p/31662#M5567</link>
    <description>&lt;P&gt;Hi tmuthuk&lt;/P&gt;

&lt;P&gt;your regex does not match the &lt;EM&gt;dateofbirth&lt;/EM&gt;, d{4} looks for four d's and not four digits. I've played around at &lt;A href="http://gskinner.com/RegExr/"&gt;RegExr&lt;/A&gt; and found that this regex&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;\d{4}-\d{2}-\d{2}(?!T)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;will match the &lt;EM&gt;dateofbirth&lt;/EM&gt; in your provided log text.&lt;/P&gt;

&lt;P&gt;cheers,&lt;BR /&gt;
MuS&lt;/P&gt;</description>
    <pubDate>Tue, 14 May 2013 09:44:20 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2013-05-14T09:44:20Z</dc:date>
    <item>
      <title>Masking a data at search time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Masking-a-data-at-search-time/m-p/31661#M5566</link>
      <description>&lt;P&gt;There is log which we have n index has sensitive information like Date of birth /SSN /Credit card &lt;/P&gt;

&lt;P&gt;I want to mask the sensitive information at execution time . Here is the sample log &lt;/P&gt;

&lt;P&gt;...................&lt;BR /&gt;
  &lt;A href="ns6:Date_Time"&gt;ns6:Date_Time&lt;/A&gt;2013-05-13T01:00:09&lt;A href="https://answers.splunk.comns6:Date_Time"&gt;/ns6:Date_Time&lt;/A&gt;&lt;BR /&gt;
    &lt;A href="ns6:UpdateSource"&gt;ns6:UpdateSource&lt;/A&gt;LY&lt;A href="https://answers.splunk.comns6:UpdateSource"&gt;/ns6:UpdateSource&lt;/A&gt;&lt;BR /&gt;
    &lt;A href="ns7:Person"&gt;ns7:Person&lt;/A&gt;&lt;BR /&gt;
        &lt;A href="ns7:FirstName"&gt;ns7:FirstName&lt;/A&gt;Test&lt;A href="https://answers.splunk.comns7:FirstName"&gt;/ns7:FirstName&lt;/A&gt;&lt;BR /&gt;
        &lt;A href="ns7:LastName"&gt;ns7:LastName&lt;/A&gt;user&lt;A href="https://answers.splunk.comns7:LastName"&gt;/ns7:LastName&lt;/A&gt;&lt;BR /&gt;
        &lt;A href="ns7:DateOfBirth"&gt;ns7:DateOfBirth&lt;/A&gt;1984-03-03&lt;A href="https://answers.splunk.comns7:DateOfBirth"&gt;/ns7:DateOfBirth&lt;/A&gt;&lt;BR /&gt;
......................&lt;/P&gt;

&lt;P&gt;I want to mask the data of birth as  below &lt;/P&gt;

&lt;P&gt;&lt;A href="ns7:DateOfBirth"&gt;ns7:DateOfBirth&lt;/A&gt;XXXX-XX-XX&lt;A href="https://answers.splunk.comns7:DateOfBirth"&gt;/ns7:DateOfBirth&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;The transforms.conf i used is &lt;/P&gt;

&lt;P&gt;REGEX = (?m)^(.&lt;EM&gt;):DateOfBirth&amp;gt;\d{4}-d{2}-d{2}(.&lt;/EM&gt;)$&lt;BR /&gt;
FORMAT = $1:DateOfBirth&amp;gt;####-##-##$2&lt;BR /&gt;
DEST_KEY = _raw&lt;/P&gt;

&lt;P&gt;But it is not working . Can anyone please  help on this  ?&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2013 18:49:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Masking-a-data-at-search-time/m-p/31661#M5566</guid>
      <dc:creator>tmuthuk</dc:creator>
      <dc:date>2013-05-13T18:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: Masking a data at search time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Masking-a-data-at-search-time/m-p/31662#M5567</link>
      <description>&lt;P&gt;Hi tmuthuk&lt;/P&gt;

&lt;P&gt;your regex does not match the &lt;EM&gt;dateofbirth&lt;/EM&gt;, d{4} looks for four d's and not four digits. I've played around at &lt;A href="http://gskinner.com/RegExr/"&gt;RegExr&lt;/A&gt; and found that this regex&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;\d{4}-\d{2}-\d{2}(?!T)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;will match the &lt;EM&gt;dateofbirth&lt;/EM&gt; in your provided log text.&lt;/P&gt;

&lt;P&gt;cheers,&lt;BR /&gt;
MuS&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2013 09:44:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Masking-a-data-at-search-time/m-p/31662#M5567</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2013-05-14T09:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: Masking a data at search time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Masking-a-data-at-search-time/m-p/31663#M5568</link>
      <description>&lt;P&gt;The key issue here appears to be that you're defining a mask at &lt;STRONG&gt;index time&lt;/STRONG&gt;, not at &lt;STRONG&gt;search time&lt;/STRONG&gt;. See &lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.2/Data/Anonymizedatausingconfigurationfiles#Through_a_regex_transform"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.2/Data/Anonymizedatausingconfigurationfiles#Through_a_regex_transform&lt;/A&gt; for reference.&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2013 10:59:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Masking-a-data-at-search-time/m-p/31663#M5568</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-05-14T10:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: Masking a data at search time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Masking-a-data-at-search-time/m-p/31664#M5569</link>
      <description>&lt;P&gt;what if the data is coming from dbconnect query ?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 16:53:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Masking-a-data-at-search-time/m-p/31664#M5569</guid>
      <dc:creator>vkakani60</dc:creator>
      <dc:date>2017-10-06T16:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: Masking a data at search time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Masking-a-data-at-search-time/m-p/31665#M5570</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;try to add a next definitions on search node's props.conf&lt;BR /&gt;
--8&amp;lt;---&lt;BR /&gt;
[your-source-type]&lt;BR /&gt;
EXTRACT-DateOfBirth = \d{4}-\d{2}-\d{2}&lt;BR /&gt;
EVAL-DateOfBirth = if(isnull(DateOfBirth),NULL,"####-##-##")&lt;BR /&gt;
EVAL-_raw = replace(_raw,"\d{4}-\d{2}-\d{2}","####-##-##")&lt;BR /&gt;
--8&amp;lt;---&lt;/P&gt;

&lt;P&gt;And to metadata/default.meta&lt;BR /&gt;
---8&amp;lt;--&lt;BR /&gt;
[props/your-source-type/EXTRACT-DateOfBirth]&lt;BR /&gt;
access = read : [ * ], write : [ admin ]&lt;BR /&gt;
export = system&lt;BR /&gt;
--8&amp;lt;--&lt;/P&gt;

&lt;P&gt;These are working on our client's environment when we have to mask some other fields.&lt;/P&gt;

&lt;P&gt;And if there are situation where you have to mask several fields on _raw then you should use next one on props.conf&lt;/P&gt;

&lt;P&gt;--8&amp;lt;---&lt;BR /&gt;
EVAL-_raw = replace(_raw, "(field1|field2|field3)=[([^]]+)]","\1=[####]")&lt;BR /&gt;
EVAL-field1 = if(isnull(field1),NULL,"[####]")&lt;BR /&gt;
EVAL-field2 = if(isnull(field2),NULL,"[####]")&lt;BR /&gt;
EVAL-field3 = if(isnull(field3),NULL,"[####]")&lt;BR /&gt;
--8&amp;lt;--&lt;/P&gt;

&lt;P&gt;and of course to default.meta should be added all those definitions so no-one cannot update those by "accidentally".&lt;/P&gt;

&lt;P&gt;where input is&lt;BR /&gt;
field1=[asa],field2=[asdaa] etc.&lt;/P&gt;

&lt;P&gt;regards Ismo&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:37:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Masking-a-data-at-search-time/m-p/31665#M5570</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2020-09-29T18:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: Masking a data at search time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Masking-a-data-at-search-time/m-p/669002#M112151</link>
      <description>&lt;P&gt;Hi, looks nice, thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2023 12:38:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Masking-a-data-at-search-time/m-p/669002#M112151</guid>
      <dc:creator>splunkreal</dc:creator>
      <dc:date>2023-11-17T12:38:56Z</dc:date>
    </item>
  </channel>
</rss>

