<?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: replace - search reference command questions in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/replace-search-reference-command-questions/m-p/30501#M1261</link>
    <description>&lt;P&gt;Common issue, use sed mode in rex&lt;/P&gt;

&lt;P&gt;Example&lt;/P&gt;

&lt;P&gt;rex field=ccnumber mode=sed "s/(\d{4}-){4}/XXXX-XXXX-XXXX-XXXX/g".&lt;/P&gt;</description>
    <pubDate>Fri, 09 Aug 2013 15:13:56 GMT</pubDate>
    <dc:creator>davecroto</dc:creator>
    <dc:date>2013-08-09T15:13:56Z</dc:date>
    <item>
      <title>replace - search reference command questions</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/replace-search-reference-command-questions/m-p/30500#M1260</link>
      <description>&lt;P&gt;Please see URL that I am referring to: &lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.2/SearchReference/Replace"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.2/SearchReference/Replace&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I am trying to utilize a log that has url values that have been percent encoded.  I want to replace these encoding characters with their decoded meanings.  Example: We%20alerted%20our%20team%20to%20the%20issue.%20We%20apologize%20for%20this%20inconvenience.%20Please%20try%20again%20later.&lt;/P&gt;

&lt;P&gt;Based on the above link's examples, I tried the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| replace "%20" with " " in errorMessage | top errorMessage
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The search runs but I still have these characters in my errorMessage field.  Eventually I'll want something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| replace "%20" with " ", "%2C" with ",", "%27" with "'" in field1 field2 field3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What am I doing wrong?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2013 14:43:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/replace-search-reference-command-questions/m-p/30500#M1260</guid>
      <dc:creator>jluste</dc:creator>
      <dc:date>2013-08-09T14:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: replace - search reference command questions</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/replace-search-reference-command-questions/m-p/30501#M1261</link>
      <description>&lt;P&gt;Common issue, use sed mode in rex&lt;/P&gt;

&lt;P&gt;Example&lt;/P&gt;

&lt;P&gt;rex field=ccnumber mode=sed "s/(\d{4}-){4}/XXXX-XXXX-XXXX-XXXX/g".&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2013 15:13:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/replace-search-reference-command-questions/m-p/30501#M1261</guid>
      <dc:creator>davecroto</dc:creator>
      <dc:date>2013-08-09T15:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: replace - search reference command questions</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/replace-search-reference-command-questions/m-p/30502#M1262</link>
      <description>&lt;P&gt;I've figured out another solution that works for this specific example. using eval and the urldecode() function.&lt;/P&gt;

&lt;P&gt;I did a &lt;CODE&gt;... | eval field1=urldecode(field1)&lt;/CODE&gt; and this works perfectly fine for me. Only issue is that I have to explicitly identify fields rather than have all fields taken care of at once. I tried doing a &lt;CODE&gt;... | eval _raw=urldecode(_raw)&lt;/CODE&gt; but this only works for the raw results and doesn't get updated to the splunk auto or manually extracted fields.  D'oh!&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2013 15:37:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/replace-search-reference-command-questions/m-p/30502#M1262</guid>
      <dc:creator>jluste</dc:creator>
      <dc:date>2013-08-09T15:37:35Z</dc:date>
    </item>
  </channel>
</rss>

