<?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: Props.conf: Why isn't my mask working? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Props-conf-Why-isn-t-my-mask-working/m-p/482182#M82622</link>
    <description>&lt;P&gt;Hello @morphis72 &lt;/P&gt;

&lt;P&gt;the syntax [source::mysourcetype] is wrong. Either you use [source::mysource] or [sourcetype]. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-mask = s/(.*Attribute\(userPassword, {)(.*)(}\)\].*)/\1XXXXX\2/
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Let me know how it went.&lt;/P&gt;

&lt;P&gt;P.S. SEDCMD works only at index time. You cannot change already indexed data later at search time. SEDCMD should be applied on indexer, HF oder UF if INDEXED_EXTRACTIONS is used.&lt;/P&gt;</description>
    <pubDate>Thu, 23 Apr 2020 05:52:31 GMT</pubDate>
    <dc:creator>PavelP</dc:creator>
    <dc:date>2020-04-23T05:52:31Z</dc:date>
    <item>
      <title>Props.conf: Why isn't my mask working?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Props-conf-Why-isn-t-my-mask-working/m-p/482179#M82619</link>
      <description>&lt;P&gt;I'm trying to mask out of the log below and I'm not sure what I'm doing wrong.&lt;/P&gt;

&lt;P&gt;log:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[22/Apr/2020:19:29:57 -0400] MODIFY INT conn=88927 op=65 msgID=66 PLUGIN=Modify: modifications: [Modification(replace, Attribute(userPassword, {userpassword})]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;my props.conf&lt;/P&gt;

&lt;P&gt;[source::mysourcetype]&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-mask = ^\[.+\sPLUGIN=Modify: modifications: \[Modification\(replace, Attribute\(userPassword, {.+}(.+)/(userPassword, {#####}\g/1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But, it's not matching and replacing the password with the #####'s&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2020 23:38:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Props-conf-Why-isn-t-my-mask-working/m-p/482179#M82619</guid>
      <dc:creator>morphis72</dc:creator>
      <dc:date>2020-04-22T23:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: Props.conf: Why isn't my mask working?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Props-conf-Why-isn-t-my-mask-working/m-p/482180#M82620</link>
      <description>&lt;P&gt;@morphis72 &lt;/P&gt;

&lt;P&gt;Can you please try this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-mask = 's/.*Attribute\(userPassword, {(.*)}\)\]/.*Attribute\(userPassword, {#####}\)\]$/
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Apr 2020 05:12:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Props-conf-Why-isn-t-my-mask-working/m-p/482180#M82620</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2020-04-23T05:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: Props.conf: Why isn't my mask working?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Props-conf-Why-isn-t-my-mask-working/m-p/482181#M82621</link>
      <description>&lt;P&gt;Try this : -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-mask=s/(.*?\(userPassword,\s*{).*(}\)\])/\1####\2/g
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Apr 2020 05:45:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Props-conf-Why-isn-t-my-mask-working/m-p/482181#M82621</guid>
      <dc:creator>Jawahir</dc:creator>
      <dc:date>2020-04-23T05:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: Props.conf: Why isn't my mask working?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Props-conf-Why-isn-t-my-mask-working/m-p/482182#M82622</link>
      <description>&lt;P&gt;Hello @morphis72 &lt;/P&gt;

&lt;P&gt;the syntax [source::mysourcetype] is wrong. Either you use [source::mysource] or [sourcetype]. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-mask = s/(.*Attribute\(userPassword, {)(.*)(}\)\].*)/\1XXXXX\2/
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Let me know how it went.&lt;/P&gt;

&lt;P&gt;P.S. SEDCMD works only at index time. You cannot change already indexed data later at search time. SEDCMD should be applied on indexer, HF oder UF if INDEXED_EXTRACTIONS is used.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2020 05:52:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Props-conf-Why-isn-t-my-mask-working/m-p/482182#M82622</guid>
      <dc:creator>PavelP</dc:creator>
      <dc:date>2020-04-23T05:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: Props.conf: Why isn't my mask working?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Props-conf-Why-isn-t-my-mask-working/m-p/482183#M82623</link>
      <description>&lt;P&gt;Hi @morphis72,&lt;/P&gt;

&lt;P&gt;The sed command you wrote replaces the entire log line instead of removing the password. Try out your regex here : &lt;BR /&gt;
&lt;A href="https://regex101.com/"&gt;https://regex101.com/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Also there is no need to type in the entire log line for sed to match, you can go for something similar as follows : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[password-Anon]
SEDCMD-Anon = s/Attribute\(userPassword, {userpassword}\)/Attribute(userPassword, {xxxxxxxxxxxx})/g 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The guide is here if you need more details : &lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Data/Anonymizedata#Anonymize_data_with_a_sed_script"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Data/Anonymizedata#Anonymize_data_with_a_sed_script&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;One last thing, make sure the stanza for &lt;CODE&gt;sourcetype&lt;/CODE&gt; in &lt;CODE&gt;props.conf&lt;/CODE&gt; is : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mysourcetype]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and not :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::mysourcetype]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Let me know if that helps.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
David&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2020 06:00:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Props-conf-Why-isn-t-my-mask-working/m-p/482183#M82623</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2020-04-23T06:00:08Z</dc:date>
    </item>
  </channel>
</rss>

