<?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: SED command on props in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/SED-command-on-props/m-p/459046#M129632</link>
    <description>&lt;P&gt;There are several things wrong with the SEDCMD. Try:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-ranjit=s/^(\w+\s\w+\s\w+\s)(\w+)/\1XXXXXXXX/g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That should do what you want.&lt;/P&gt;</description>
    <pubDate>Sun, 04 Nov 2018 18:31:20 GMT</pubDate>
    <dc:creator>cpetterborg</dc:creator>
    <dc:date>2018-11-04T18:31:20Z</dc:date>
    <item>
      <title>SED command on props</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SED-command-on-props/m-p/459044#M129630</link>
      <description>&lt;P&gt;Good Day all. I am trying to replace a last name using SED command on my props. &lt;BR /&gt;
my data looks like below.&lt;BR /&gt;
    asdfa asdf first last asdf&lt;BR /&gt;
    asdf asdf first last asdf&lt;BR /&gt;
    asdf asdf first last asdf&lt;/P&gt;

&lt;P&gt;My props looks like below&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mymask]
DATETIME_CONFIG=CURRENT
SHOULD_LINEMERGE=true
NO_BINARY_CHECK=true
SEDCMD-ranjit=s/\w+\s\w+\s(\w+\s)\w+/\1XXXXXXXX/g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When i upload the data into splunk my data is looking like below&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;first XXXXXXXX asdf
first XXXXXXXX asdf
first XXXXXXXX asdf
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So basically it replaced the entire data before the pattern with the capture group and the modification which is the XXXX. i could capture the whole data as a capture group and replace them but i am looking for options where i can just replace the capture group with the modification.&lt;BR /&gt;
so that my data looks like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;asdf asdf first XXXXX asdf
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 04 Nov 2018 06:29:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SED-command-on-props/m-p/459044#M129630</guid>
      <dc:creator>ranjitbrhm1</dc:creator>
      <dc:date>2018-11-04T06:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: SED command on props</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SED-command-on-props/m-p/459045#M129631</link>
      <description>&lt;P&gt;Can you post a better example of your data, your sample tells us nothing about the data and what you are attempting to replace. If we could see more, we could suggest a better &lt;CODE&gt;SED&lt;/CODE&gt; expression for you to use.&lt;/P&gt;</description>
      <pubDate>Sun, 04 Nov 2018 10:16:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SED-command-on-props/m-p/459045#M129631</guid>
      <dc:creator>sduff_splunk</dc:creator>
      <dc:date>2018-11-04T10:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: SED command on props</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SED-command-on-props/m-p/459046#M129632</link>
      <description>&lt;P&gt;There are several things wrong with the SEDCMD. Try:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-ranjit=s/^(\w+\s\w+\s\w+\s)(\w+)/\1XXXXXXXX/g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That should do what you want.&lt;/P&gt;</description>
      <pubDate>Sun, 04 Nov 2018 18:31:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SED-command-on-props/m-p/459046#M129632</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2018-11-04T18:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: SED command on props</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SED-command-on-props/m-p/459047#M129633</link>
      <description>&lt;P&gt;@ranjitbrhm1 as mentioned on Slack, if it is indeed always the 4th word that needs to be masked, this should do the trick.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Nov 2018 08:19:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SED-command-on-props/m-p/459047#M129633</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-11-05T08:19:59Z</dc:date>
    </item>
  </channel>
</rss>

