<?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: Splunk ITSI: Why is transforms not masking the data correctly? in Splunk ITSI</title>
    <link>https://community.splunk.com/t5/Splunk-ITSI/Splunk-ITSI-Why-is-transforms-not-masking-the-data-correctly/m-p/421982#M1092</link>
    <description>&lt;P&gt;I can't see any other email ID in raw data which you have provided.&lt;/P&gt;</description>
    <pubDate>Tue, 23 Apr 2019 17:45:11 GMT</pubDate>
    <dc:creator>harsmarvania57</dc:creator>
    <dc:date>2019-04-23T17:45:11Z</dc:date>
    <item>
      <title>Splunk ITSI: Why is transforms not masking the data correctly?</title>
      <link>https://community.splunk.com/t5/Splunk-ITSI/Splunk-ITSI-Why-is-transforms-not-masking-the-data-correctly/m-p/421976#M1086</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am new to splunk and learning it. However, recently i wrote transform to mask the mail ID but when i tested it is not masking the mail ID.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Transform:&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mail_id_mask]
REGEX = ([A-z0-9._%+-]+@[A-z0-9.-]+\.[A-z]{2,63})
FORMAT = ********@*********
DEST_KEY = _raw
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Sample logs:&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(29.2) 01-27-17 02:53:27 (9866:8500)  PRINTINGFN: $G_NOTIFY12_GRP_INTERNAL: abcdef.sdfrwe56@xyz.com
 (29.2) 01-27-17 02:53:27 (9866:8500)  PRINTINGFN: $G_NOTIF123Y_GRP_EXTERNAL: corP-apachesci.com
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any help would be appreciated.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2019 20:22:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-ITSI/Splunk-ITSI-Why-is-transforms-not-masking-the-data-correctly/m-p/421976#M1086</guid>
      <dc:creator>iamlearner123</dc:creator>
      <dc:date>2019-04-22T20:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk ITSI: Why is transforms not masking the data correctly?</title>
      <link>https://community.splunk.com/t5/Splunk-ITSI/Splunk-ITSI-Why-is-transforms-not-masking-the-data-correctly/m-p/421977#M1087</link>
      <description>&lt;P&gt;try rechecking the regex and also try excluding the FORMAT and see if that works&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2019 20:56:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-ITSI/Splunk-ITSI-Why-is-transforms-not-masking-the-data-correctly/m-p/421977#M1087</guid>
      <dc:creator>pruthvikrishnap</dc:creator>
      <dc:date>2019-04-22T20:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk ITSI: Why is transforms not masking the data correctly?</title>
      <link>https://community.splunk.com/t5/Splunk-ITSI/Splunk-ITSI-Why-is-transforms-not-masking-the-data-correctly/m-p/421978#M1088</link>
      <description>&lt;P&gt;Regex  is working fine but splunk is replacing the entire event with the **********************&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2019 22:10:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-ITSI/Splunk-ITSI-Why-is-transforms-not-masking-the-data-correctly/m-p/421978#M1088</guid>
      <dc:creator>iamlearner123</dc:creator>
      <dc:date>2019-04-22T22:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk ITSI: Why is transforms not masking the data correctly?</title>
      <link>https://community.splunk.com/t5/Splunk-ITSI/Splunk-ITSI-Why-is-transforms-not-masking-the-data-correctly/m-p/421979#M1089</link>
      <description>&lt;P&gt;If we look at &lt;A href="https://www.function1.com/2017/08/anonymizing-data-in-splunk" target="_blank"&gt;Anonymizing Data in Splunk&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You see the following - &lt;/P&gt;

&lt;P&gt;In this approach, a TRANSFORMS statement is called in the props.conf file and is applied to the data in the queues before being indexed.  In the example, the goal is to mask the “sensitive number" except for the last 4 digits.  &lt;/P&gt;

&lt;P&gt;—props.conf---&lt;BR /&gt;
[hr_app]&lt;BR /&gt;
TRANSFORMS-hr_app_logs_mask_data = mask_sn&lt;/P&gt;

&lt;P&gt;—transforms.conf---&lt;BR /&gt;
[mask_sn]&lt;BR /&gt;
REGEX = (?m)^(.&lt;EM&gt;)SN=\d{3}-\d{2}-(\d{4}.&lt;/EM&gt;)&lt;BR /&gt;
DEST_KEY = _raw&lt;BR /&gt;
FORMAT = $1SN=###-##-$2&lt;/P&gt;

&lt;P&gt;This is the result of the sample event going through the transformation&lt;BR /&gt;
“This is an event with a sensitive number in it. SN=###-##-1111.  This should be masked”&lt;/P&gt;

&lt;P&gt;The approach here is to match the first part of the event (.*), then the part to be masked (SN=…), then the last 4 digits and the rest of the event.  These last two parts are to be retained when the event data is written back out to the "_raw" field specified by the "DEST_KEY."  Note that the “FORMAT” setting specifies how the event will be re-written.  The "$1" and "$2" refer to the two capturing groups in the "REGEX" field.&lt;/P&gt;

&lt;P&gt;Meaning, the REGEX captures the &lt;STRONG&gt;entire&lt;/STRONG&gt; event, breaks it up to multiple capturing groups and then reconstructs the event.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:12:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-ITSI/Splunk-ITSI-Why-is-transforms-not-masking-the-data-correctly/m-p/421979#M1089</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2020-09-30T00:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk ITSI: Why is transforms not masking the data correctly?</title>
      <link>https://community.splunk.com/t5/Splunk-ITSI/Splunk-ITSI-Why-is-transforms-not-masking-the-data-correctly/m-p/421980#M1090</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;You can use SEDCMD in props.conf to achieve this easily.&lt;/P&gt;

&lt;P&gt;Please try below config in props.conf on Heavy Forwarder/Indexer whichever comes first from Universal Forwarder.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yoursourcetype]
SEDCMD-mailidmask = s/^(\N+[\:]\s)[^\@]+\@[^\n]+/\1XXXX/
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 Apr 2019 10:02:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-ITSI/Splunk-ITSI-Why-is-transforms-not-masking-the-data-correctly/m-p/421980#M1090</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-04-23T10:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk ITSI: Why is transforms not masking the data correctly?</title>
      <link>https://community.splunk.com/t5/Splunk-ITSI/Splunk-ITSI-Why-is-transforms-not-masking-the-data-correctly/m-p/421981#M1091</link>
      <description>&lt;P&gt;Thank you for the reply. however, it is not masking the all the email ID's. it masked only the first email ID (&lt;A href="mailto:abcdef.sdfrwe56@xyz.com"&gt;abcdef.sdfrwe56@xyz.com&lt;/A&gt;) when i tested in regex101.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2019 17:43:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-ITSI/Splunk-ITSI-Why-is-transforms-not-masking-the-data-correctly/m-p/421981#M1091</guid>
      <dc:creator>iamlearner123</dc:creator>
      <dc:date>2019-04-23T17:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk ITSI: Why is transforms not masking the data correctly?</title>
      <link>https://community.splunk.com/t5/Splunk-ITSI/Splunk-ITSI-Why-is-transforms-not-masking-the-data-correctly/m-p/421982#M1092</link>
      <description>&lt;P&gt;I can't see any other email ID in raw data which you have provided.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2019 17:45:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-ITSI/Splunk-ITSI-Why-is-transforms-not-masking-the-data-correctly/m-p/421982#M1092</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-04-23T17:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk ITSI: Why is transforms not masking the data correctly?</title>
      <link>https://community.splunk.com/t5/Splunk-ITSI/Splunk-ITSI-Why-is-transforms-not-masking-the-data-correctly/m-p/421983#M1093</link>
      <description>&lt;P&gt;Like, i was testing the regex for the couple of other events. Please find the below events. When i put the below events in the regex101, masking is not working.  I am trying achieve a dynamic regex that will work for any email ID.&lt;/P&gt;

&lt;P&gt;(14.2) 01-27-19 02:53:28 (8544:8500)  PRINTFN: $G_NOTIFY_GRP_INTERNAL: &lt;A href="mailto:harry.peter07@abc.com" target="_blank"&gt;harry.peter07@abc.com&lt;/A&gt;&lt;BR /&gt;
(14.2) 01-27-18 02:53:27 (8544:8500)  PRINTFN: $G_NOTIFY_GRP_EXTERNAL: &lt;A href="mailto:SAAS-Learning_MDA@trsq.com" target="_blank"&gt;SAAS-Learning_MDA@trsq.com&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:13:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-ITSI/Splunk-ITSI-Why-is-transforms-not-masking-the-data-correctly/m-p/421983#M1093</guid>
      <dc:creator>iamlearner123</dc:creator>
      <dc:date>2020-09-30T00:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk ITSI: Why is transforms not masking the data correctly?</title>
      <link>https://community.splunk.com/t5/Splunk-ITSI/Splunk-ITSI-Why-is-transforms-not-masking-the-data-correctly/m-p/421984#M1094</link>
      <description>&lt;P&gt;Here you go &lt;A href="https://regex101.com/r/yHxyYg/1"&gt;https://regex101.com/r/yHxyYg/1&lt;/A&gt; , it is working fine&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2019 18:06:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-ITSI/Splunk-ITSI-Why-is-transforms-not-masking-the-data-correctly/m-p/421984#M1094</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-04-23T18:06:40Z</dc:date>
    </item>
  </channel>
</rss>

