<?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 IP in PROPS.CONF using SEDCMD in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Masking-IP-in-PROPS-CONF-using-SEDCMD/m-p/221173#M43418</link>
    <description>&lt;P&gt;Thanks a lot! It worked...&lt;/P&gt;</description>
    <pubDate>Wed, 18 Nov 2015 14:25:19 GMT</pubDate>
    <dc:creator>csingh23</dc:creator>
    <dc:date>2015-11-18T14:25:19Z</dc:date>
    <item>
      <title>Masking IP in PROPS.CONF using SEDCMD</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Masking-IP-in-PROPS-CONF-using-SEDCMD/m-p/221168#M43413</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;

&lt;P&gt;I am trying to run a sedcmd in props.conf and this is regex that I need to replace my internal IPs.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-replace=s/"Device Address"=(\d{1,3}\.\d{1,3}\.\d{1,3})\.(\d{1,3})/"Device Address"=123.234.222.111/g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When I restart Splunk and run a search on Splunk Web, I do not see my IPs masked, they are still the same. &lt;BR /&gt;
Also I did find similar questions about multiple sed commands in one stanza in same props.conf, but it isn't likely to be working on mine.&lt;/P&gt;

&lt;P&gt;Any help will be greatly appreciated.&lt;/P&gt;

&lt;P&gt;Thank You!&lt;/P&gt;</description>
      <pubDate>Sat, 07 Nov 2015 18:16:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Masking-IP-in-PROPS-CONF-using-SEDCMD/m-p/221168#M43413</guid>
      <dc:creator>csingh23</dc:creator>
      <dc:date>2015-11-07T18:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: Masking IP in PROPS.CONF using SEDCMD</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Masking-IP-in-PROPS-CONF-using-SEDCMD/m-p/221169#M43414</link>
      <description>&lt;P&gt;Assuming the precise things you are trying to change appear in your events like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"Device Address"=123.234.222.111
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can test your sedcmd in a rex in a search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;* | eval a_test="\"Device Address\"=123.234.222.111" | rex mode=sed field=a_test "s/\"Device Address\"=(\d{1,3}).(\d{1,3}).(\d{1,3}).(\d{1,3})/\"Device Address\"=111.222.333.444/"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That results in a field a_test that's precisely like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"Device Address"=111.222.333.444
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So if you want to sedcmd it in props, you will end up like this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-replace=s/\"Device Address\"=(\d{1,3}).(\d{1,3}).(\d{1,3}).(\d{1,3})/\"Device Address\"=111.222.333.444/
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Give that a try and let us know how it goes.  You'll need to make sure you put it in a stanza that applies to the sourcetype/source that matches the data.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Nov 2015 19:49:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Masking-IP-in-PROPS-CONF-using-SEDCMD/m-p/221169#M43414</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2015-11-07T19:49:13Z</dc:date>
    </item>
    <item>
      <title>Re: Masking IP in PROPS.CONF using SEDCMD</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Masking-IP-in-PROPS-CONF-using-SEDCMD/m-p/221170#M43415</link>
      <description>&lt;P&gt;Oh, the regular sedcmd doesn't need quotes around it, so I believe that means you don't need to escape the quotes.  For the sedcmd, it should then be:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-replace=s/"Device Address"=(\d{1,3}).(\d{1,3}).(\d{1,3}).(\d{1,3})/"Device Address"=111.222.333.444/
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sorry about that.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Nov 2015 19:56:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Masking-IP-in-PROPS-CONF-using-SEDCMD/m-p/221170#M43415</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2015-11-07T19:56:08Z</dc:date>
    </item>
    <item>
      <title>Re: Masking IP in PROPS.CONF using SEDCMD</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Masking-IP-in-PROPS-CONF-using-SEDCMD/m-p/221171#M43416</link>
      <description>&lt;P&gt;That works. In raw events it is masking but It still did not mask the IPs in Device Address field. I need to mask the field value of this field.&lt;/P&gt;

&lt;P&gt;For eg:&lt;BR /&gt;
11/7/15  2015/08.23, 123.234.222.111&lt;BR /&gt;
1:40:54:000 PM Device Address= 172.186.151.234&lt;/P&gt;

&lt;P&gt;I want to mask the Device address field too. Any ideas how to do that.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 07 Nov 2015 20:26:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Masking-IP-in-PROPS-CONF-using-SEDCMD/m-p/221171#M43416</guid>
      <dc:creator>csingh23</dc:creator>
      <dc:date>2015-11-07T20:26:42Z</dc:date>
    </item>
    <item>
      <title>Re: Masking IP in PROPS.CONF using SEDCMD</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Masking-IP-in-PROPS-CONF-using-SEDCMD/m-p/221172#M43417</link>
      <description>&lt;P&gt;Sorry, I misunderstood.  I might still have it wrong, but try this...&lt;/P&gt;

&lt;P&gt;You can mask off all of the IPs in those events by changing the sedcmd to not worry about the string "Device Address", and add the global flag at the end (like you originally had).  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-replace=s/(\d{1,3}).(\d{1,3}).(\d{1,3}).(\d{1,3})/1.2.3.4/g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That takes any IPv4 address in those events and replaces them with "1.2.3.4"&lt;/P&gt;

&lt;P&gt;If that's what you need, great!  If not, can you take the event you listed just above and please mask it off like you want so I can actually see what it is you want?  Use something like A.B.C.D as the "masked" address so I can be sure the right things get changed.&lt;/P&gt;

&lt;P&gt;Addendum: You know, I just realized that we're not using capture groups for anything, so we don't need the () groups.  Untested, but this should work just fine (and be a lot easier to read).&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-replace=s/\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}/1.2.3.4/g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Sun, 08 Nov 2015 01:48:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Masking-IP-in-PROPS-CONF-using-SEDCMD/m-p/221172#M43417</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2015-11-08T01:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: Masking IP in PROPS.CONF using SEDCMD</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Masking-IP-in-PROPS-CONF-using-SEDCMD/m-p/221173#M43418</link>
      <description>&lt;P&gt;Thanks a lot! It worked...&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2015 14:25:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Masking-IP-in-PROPS-CONF-using-SEDCMD/m-p/221173#M43418</guid>
      <dc:creator>csingh23</dc:creator>
      <dc:date>2015-11-18T14:25:19Z</dc:date>
    </item>
  </channel>
</rss>

