<?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 How to edit my rex command to replace a string? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-command-to-replace-a-string/m-p/289197#M87514</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;
I want to replace the string "\x00" with spaces.&lt;BR /&gt;
"CP REQUESTED \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"  and i tried below commands but it didn't work.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex mode=sed field=EXCP_MSG "s/\\x00/ /g"
replace \\x00 WITH " " IN EXCP_MSG|stats count  by EXCP_MSG
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can anyone help me and also which command is better to use?&lt;/P&gt;</description>
    <pubDate>Thu, 11 May 2017 20:18:12 GMT</pubDate>
    <dc:creator>chintan_shah</dc:creator>
    <dc:date>2017-05-11T20:18:12Z</dc:date>
    <item>
      <title>How to edit my rex command to replace a string?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-command-to-replace-a-string/m-p/289197#M87514</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I want to replace the string "\x00" with spaces.&lt;BR /&gt;
"CP REQUESTED \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"  and i tried below commands but it didn't work.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex mode=sed field=EXCP_MSG "s/\\x00/ /g"
replace \\x00 WITH " " IN EXCP_MSG|stats count  by EXCP_MSG
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can anyone help me and also which command is better to use?&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2017 20:18:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-command-to-replace-a-string/m-p/289197#M87514</guid>
      <dc:creator>chintan_shah</dc:creator>
      <dc:date>2017-05-11T20:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my rex command to replace a string?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-command-to-replace-a-string/m-p/289198#M87515</link>
      <description>&lt;P&gt;The first rule of RegEx and backslashes: if at first you don't succeed, add another backslash:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval EXCP_MSG="CP REQUESTED \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 

| rename COMMENT AS "Everything above fakes sample data; everything below is your solution"

| rex mode=sed field=EXCP_MSG "s/\\\\x00/ /g"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 May 2017 20:47:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-command-to-replace-a-string/m-p/289198#M87515</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-05-11T20:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my rex command to replace a string?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-command-to-replace-a-string/m-p/289199#M87516</link>
      <description>&lt;P&gt;Thanks Woodcock&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2017 21:11:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-command-to-replace-a-string/m-p/289199#M87516</guid>
      <dc:creator>chintan_shah</dc:creator>
      <dc:date>2017-05-11T21:11:07Z</dc:date>
    </item>
  </channel>
</rss>

