<?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 the data.. in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-mask-the-data/m-p/469609#M99625</link>
    <description>&lt;P&gt;Happy to helped you!&lt;BR /&gt;
Ciao and Next Time!&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
    <pubDate>Tue, 29 Oct 2019 11:41:56 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2019-10-29T11:41:56Z</dc:date>
    <item>
      <title>Not able to mask the data..</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-mask-the-data/m-p/469598#M99614</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;For my learning purpose, I have installed splunk and configured universal forwarder. Now I want to Hide/mask some data. But not able to do, Below are the required details.&lt;BR /&gt;
Please let me know anything else is needed.&lt;/P&gt;

&lt;P&gt;Sample log&lt;BR /&gt;
 &lt;CODE&gt;SERVICE NOTIFICATION: 9123456780;www.test.com;Kibana_Service_Check;CRITICAL;notify-service-by-email;connect to address xx.xx.xxx.xxx and port 5601: Connection refused&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;Sample Mobile Number(9123456780) need to masked &lt;/P&gt;

&lt;P&gt;Filed details:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Contact_group=9123456780
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[nagios]
TRANSFORMS-anonymize = Contact_group-anonymizer
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[Contact_group-anonymizer]
REGEX = (?m)^(.*)Contact_group=^[\[\]\d\s\w]+.\s(?&amp;lt;Contact_group&amp;gt;[a-z]+).
FORMAT = $1Contact_group=###########$2
DEST_KEY = _raw
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 25 Oct 2019 06:28:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-mask-the-data/m-p/469598#M99614</guid>
      <dc:creator>vikcee</dc:creator>
      <dc:date>2019-10-25T06:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to mask the data..</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-mask-the-data/m-p/469599#M99615</link>
      <description>&lt;P&gt;Where did you deploy this masking config? This should be on a full Splunk Enterprise instance, not on the UF.&lt;/P&gt;

&lt;P&gt;Also: your regex looks for 'Contact_group=', while that string does not exist in your raw event. Also not sure what that &lt;CODE&gt;^&lt;/CODE&gt; is doing there, behind the 'Contact_group='.&lt;/P&gt;

&lt;P&gt;So I think your regex needs some work. Try tools like regex101.com to test your regex and see if it captures what you need.&lt;/P&gt;

&lt;P&gt;Also: this may be done much simpler and much more efficiently by using a SEDCMD in props.conf.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:45:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-mask-the-data/m-p/469599#M99615</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2020-09-30T02:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to mask the data..</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-mask-the-data/m-p/469600#M99616</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;
you have to modify&lt;BR /&gt;
&lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your_sourcetype]
TRANSFORMS-anonymize = session-anonymizer
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;transforms.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [session-anonymizer]
 REGEX = ^SERVICE NOTIFICATION:\s[^;]*(.*)
 FORMAT = ^SERVICE NOTIFICATION:\s########,$1
 DEST_KEY = _raw
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;you  can test regex at &lt;A href="https://regex101.com/r/WNni5C/1"&gt;https://regex101.com/r/WNni5C/1&lt;/A&gt; .&lt;/P&gt;

&lt;P&gt;For more info, see at &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.0/Data/Anonymizedata"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.0/Data/Anonymizedata&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2019 08:19:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-mask-the-data/m-p/469600#M99616</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-10-25T08:19:14Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to mask the data..</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-mask-the-data/m-p/469601#M99617</link>
      <description>&lt;P&gt;Hello Sir,&lt;/P&gt;

&lt;P&gt;Thanks for the quick response. &lt;/P&gt;

&lt;P&gt;I have  added your comment as it is in props.conf and transform.conf,but its not working.&lt;/P&gt;

&lt;P&gt;below is the log file.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[1571992954] SERVICE NOTIFICATION: nagiosadmin;www.test.com;Elastic_Service_Check;CRITICAL;notify-service-by-email;connect to address xx.xx.xxx.xxx and port 9200: Connection refused&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;for my case nagiosadmin or 9123456780 are the filed with filed name "Contact_group". does this has anything to do.&lt;/P&gt;

&lt;P&gt;And I have one more question: In regex section what exactly is needed?&lt;/P&gt;

&lt;P&gt;thanks&lt;BR /&gt;
Vikash&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2019 08:55:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-mask-the-data/m-p/469601#M99617</guid>
      <dc:creator>vikcee</dc:creator>
      <dc:date>2019-10-25T08:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to mask the data..</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-mask-the-data/m-p/469602#M99618</link>
      <description>&lt;P&gt;Hello Sir,&lt;/P&gt;

&lt;P&gt;I am very new to Splunk. I have deployed the above conf in props.config and transform.conf. I am not sure about the Regex section what exactly need to be done. Do we need to write regex to fetch the filed that we are planning to mask or something else. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&lt;A href="https://regex101.com/r/7roqEj/1" target="test_blank"&gt;https://regex101.com/r/7roqEj/1&lt;/A&gt; 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And thanks for the suggestion about SEDCMD, I will check the document, How can I do this.&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Vikash&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2019 09:01:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-mask-the-data/m-p/469602#M99618</guid>
      <dc:creator>vikcee</dc:creator>
      <dc:date>2019-10-25T09:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to mask the data..</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-mask-the-data/m-p/469603#M99619</link>
      <description>&lt;P&gt;HI vikcee,&lt;BR /&gt;
section is a part of the source that must remain as original, in you sample: the first part must remain as original, the central part must bu masked, the second section must remain as original.&lt;/P&gt;

&lt;P&gt;The sample now is different, use this regex in transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = ^(.*)SERVICE NOTIFICATION:\s[^;]*;(.*)
FORMAT = ^$1SERVICE NOTIFICATION:\s########;$2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can test regex at &lt;A href="https://regex101.com/r/WNni5C/2"&gt;https://regex101.com/r/WNni5C/2&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2019 09:12:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-mask-the-data/m-p/469603#M99619</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-10-25T09:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to mask the data..</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-mask-the-data/m-p/469604#M99620</link>
      <description>&lt;P&gt;Hi Vikcee, &lt;BR /&gt;
Please modify as like below&lt;BR /&gt;
props.conf&lt;/P&gt;

&lt;P&gt;[your_sourcetype]&lt;BR /&gt;
 TRANSFORMS = session-anonymizer&lt;BR /&gt;
transforms.conf&lt;/P&gt;

&lt;P&gt;[session-anonymizer]&lt;BR /&gt;
  DEST_KEY = _raw&lt;BR /&gt;
  REGEX = ^SERVICE NOTIFICATION:\s\d+&lt;BR /&gt;
  FORMAT = $1xxxxxxxxxx&lt;/P&gt;

&lt;P&gt;To answer your question.&lt;BR /&gt;
By default splunk will extract the field. Sometimes splunk would n't able to extract the field. So we need to write a regex to extract the field whichever we want. In this scenario, we must need to write to regex to tell splunk which wants to be masked.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2019 09:41:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-mask-the-data/m-p/469604#M99620</guid>
      <dc:creator>kartm2020</dc:creator>
      <dc:date>2019-10-25T09:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to mask the data..</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-mask-the-data/m-p/469605#M99621</link>
      <description>&lt;P&gt;Try this on your indexers:&lt;/P&gt;

&lt;H4&gt;props.conf&lt;/H4&gt;

&lt;PRE&gt;&lt;CODE&gt;[nagios]
SEDCMD-anonymize_Contact_group = s/SERVICE NOTIFICATION:\s+\d+/SERVICE NOTIFICATION: Contact_group=###########/
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 25 Oct 2019 18:34:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-mask-the-data/m-p/469605#M99621</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-10-25T18:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to mask the data..</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-mask-the-data/m-p/469606#M99622</link>
      <description>&lt;P&gt;Hello sir,&lt;/P&gt;

&lt;P&gt;Thanks a lot. Its working as expected.  But again one more question. If I have to mast partially. Such as last 5 characters or 5 characters from start.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2019 10:15:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-mask-the-data/m-p/469606#M99622</guid>
      <dc:creator>vikcee</dc:creator>
      <dc:date>2019-10-29T10:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to mask the data..</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-mask-the-data/m-p/469607#M99623</link>
      <description>&lt;P&gt;You're welcome!&lt;BR /&gt;
Anyway, the approach is the same, you have only to change the regex:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = ^(.*)SERVICE NOTIFICATION:\s[^;]{5}(.*)
FORMAT = ^$1SERVICE NOTIFICATION:\s#####;$2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In this way only the first 5 chars of the number or of the user are masked and the other are showed.&lt;BR /&gt;
You can test it at &lt;A href="https://regex101.com/r/WNni5C/3"&gt;https://regex101.com/r/WNni5C/3&lt;/A&gt; .&lt;/P&gt;

&lt;P&gt;Ciao and Next time!&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2019 10:34:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-mask-the-data/m-p/469607#M99623</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-10-29T10:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to mask the data..</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-mask-the-data/m-p/469608#M99624</link>
      <description>&lt;P&gt;Hello Sir,&lt;/P&gt;

&lt;P&gt;Got the point..Thanks A lot.&lt;/P&gt;

&lt;P&gt;For my practice I have masked all the field one by one &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt; &lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Vikash&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2019 11:31:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-mask-the-data/m-p/469608#M99624</guid>
      <dc:creator>vikcee</dc:creator>
      <dc:date>2019-10-29T11:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to mask the data..</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-mask-the-data/m-p/469609#M99625</link>
      <description>&lt;P&gt;Happy to helped you!&lt;BR /&gt;
Ciao and Next Time!&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2019 11:41:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Not-able-to-mask-the-data/m-p/469609#M99625</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-10-29T11:41:56Z</dc:date>
    </item>
  </channel>
</rss>

