<?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 Replace field value using rex in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Replace-field-value-using-rex/m-p/452468#M8206</link>
    <description>&lt;P&gt;XXXXXX y XXXXXX y&lt;/P&gt;

&lt;P&gt;So this is my value of a field z . How to replace this with XXXXXX y.&lt;/P&gt;

&lt;P&gt;Below is not working &lt;/P&gt;

&lt;P&gt;rex mode=sed field=z "s/XXXXXX y XXXXXX y/XXXXXX y/g"&lt;/P&gt;</description>
    <pubDate>Sun, 09 Sep 2018 06:25:22 GMT</pubDate>
    <dc:creator>Nadhiyaa</dc:creator>
    <dc:date>2018-09-09T06:25:22Z</dc:date>
    <item>
      <title>Replace field value using rex</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Replace-field-value-using-rex/m-p/452468#M8206</link>
      <description>&lt;P&gt;XXXXXX y XXXXXX y&lt;/P&gt;

&lt;P&gt;So this is my value of a field z . How to replace this with XXXXXX y.&lt;/P&gt;

&lt;P&gt;Below is not working &lt;/P&gt;

&lt;P&gt;rex mode=sed field=z "s/XXXXXX y XXXXXX y/XXXXXX y/g"&lt;/P&gt;</description>
      <pubDate>Sun, 09 Sep 2018 06:25:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Replace-field-value-using-rex/m-p/452468#M8206</guid>
      <dc:creator>Nadhiyaa</dc:creator>
      <dc:date>2018-09-09T06:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: Replace field value using rex</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Replace-field-value-using-rex/m-p/452469#M8207</link>
      <description>&lt;P&gt;i tried this it seems to be working-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults |eval z="XXXXXX y XXXXXX y"|rex mode=sed field=z "s/XXXXXX y XXXXXX y/XXXXXX y/g"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;what is expected output ..can you provide some details..&lt;/P&gt;</description>
      <pubDate>Sun, 09 Sep 2018 06:35:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Replace-field-value-using-rex/m-p/452469#M8207</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-09-09T06:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: Replace field value using rex</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Replace-field-value-using-rex/m-p/452470#M8208</link>
      <description>&lt;P&gt;when we do eval , it works .&lt;/P&gt;

&lt;P&gt;when i do directly after the stats command ,it is not &lt;/P&gt;</description>
      <pubDate>Sun, 09 Sep 2018 08:51:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Replace-field-value-using-rex/m-p/452470#M8208</guid>
      <dc:creator>Nadhiyaa</dc:creator>
      <dc:date>2018-09-09T08:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: Replace field value using rex</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Replace-field-value-using-rex/m-p/452471#M8209</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex mode=sed field=z "s/(XXXXXX\s+y)\s+XXXXXX\s+y/\1/g"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;the \s+ should grab tabs and whitespace.  The parens &lt;CODE&gt;()&lt;/CODE&gt; and \1 will make the first part of that string a capture group, and use what is captured as the replacement.&lt;/P&gt;</description>
      <pubDate>Sun, 09 Sep 2018 12:10:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Replace-field-value-using-rex/m-p/452471#M8209</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2018-09-09T12:10:07Z</dc:date>
    </item>
  </channel>
</rss>

