<?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 password with rex command in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/masking-password-with-rex-command/m-p/523850#M88455</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/227362"&gt;@moin140586&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;in your regex I see that you didin't escaped "=", anyway, try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval _raw="this is the test message to demonstrate two fields of password abc.password=QWERTYUI and in the same line we also have another password like xyyz.password=Q%1^WRTy."
| rex mode=sed "s/abc\.password\=\w+.*xyyz\.password\=.*/abc\.password\=********.*xyyz\.password\=********/g"&lt;/LI-CODE&gt;&lt;P&gt;The regex can be used also in props.conf:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SEDCMD-anonymize = s/abc\.password\=\w+.*xyyz\.password\=.*/abc\.password\=********.*xyyz\.password\=********/g&lt;/LI-CODE&gt;&lt;P&gt;If you can share a sample of your logs I could be more precise.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Fri, 09 Oct 2020 06:09:29 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2020-10-09T06:09:29Z</dc:date>
    <item>
      <title>masking password with rex command</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/masking-password-with-rex-command/m-p/523845#M88453</link>
      <description>&lt;P&gt;hi i have a data where there are two fields with password which i need to mask via props.conf and also in the search.&lt;/P&gt;&lt;P&gt;the data looks like this : "this is the test message to demonstrate two fields of password abc.password=QWERTYUI and in the same line we also have another password like xyyz.password=Q%1^WRTy."&lt;/P&gt;&lt;P&gt;rex field=_raw mode=sed "s/abc\.password=\w+/abc.password=XXXXXXXX/g"&lt;/P&gt;&lt;P&gt;i was trying my luck in the search first. i cannot do the masking in single rex sed command for both the passwords . i was able to do sucessfully for first one as its not having special characters.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Moin&lt;/P&gt;</description>
      <pubDate>Fri, 09 Oct 2020 05:32:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/masking-password-with-rex-command/m-p/523845#M88453</guid>
      <dc:creator>moin140586</dc:creator>
      <dc:date>2020-10-09T05:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: masking password with rex command</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/masking-password-with-rex-command/m-p/523850#M88455</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/227362"&gt;@moin140586&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;in your regex I see that you didin't escaped "=", anyway, try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval _raw="this is the test message to demonstrate two fields of password abc.password=QWERTYUI and in the same line we also have another password like xyyz.password=Q%1^WRTy."
| rex mode=sed "s/abc\.password\=\w+.*xyyz\.password\=.*/abc\.password\=********.*xyyz\.password\=********/g"&lt;/LI-CODE&gt;&lt;P&gt;The regex can be used also in props.conf:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SEDCMD-anonymize = s/abc\.password\=\w+.*xyyz\.password\=.*/abc\.password\=********.*xyyz\.password\=********/g&lt;/LI-CODE&gt;&lt;P&gt;If you can share a sample of your logs I could be more precise.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 09 Oct 2020 06:09:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/masking-password-with-rex-command/m-p/523850#M88455</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-10-09T06:09:29Z</dc:date>
    </item>
  </channel>
</rss>

