<?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: The &amp;quot;replace&amp;quot; function does not work well in the  element of EventHandler. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/The-quot-replace-quot-function-does-not-work-well-in-the-element/m-p/457737#M129269</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
    &amp;lt;fieldset submitButton="false" autoRun="false"&amp;gt;
     &amp;lt;input type="text" token="text" searchWhenChanged="true"&amp;gt;
       &amp;lt;label&amp;gt;field1&amp;lt;/label&amp;gt;
       &amp;lt;change&amp;gt;
         &amp;lt;eval token="form.arg"&amp;gt;replace($text$,"(\w)-(\w)","\1:\2")&amp;lt;/eval&amp;gt;
       &amp;lt;/change&amp;gt;
       &amp;lt;default&amp;gt;&amp;lt;/default&amp;gt;
     &amp;lt;/input&amp;gt;
       &amp;lt;input type="text" token="arg" searchWhenChanged="true"/&amp;gt;
   &amp;lt;/fieldset&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 28 Mar 2019 08:30:12 GMT</pubDate>
    <dc:creator>vnravikumar</dc:creator>
    <dc:date>2019-03-28T08:30:12Z</dc:date>
    <item>
      <title>The "replace" function does not work well in the  element of EventHandler.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/The-quot-replace-quot-function-does-not-work-well-in-the-element/m-p/457736#M129268</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;fieldset submitButton="false" autoRun="false"&amp;gt;
    &amp;lt;input type="text" token="text" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;field1&amp;lt;/label&amp;gt;
      &amp;lt;change&amp;gt;
        &amp;lt;eval token="arg"&amp;gt;replace($text$,"^(..).(..)$","\1:\2")&amp;lt;/eval&amp;gt;
      &amp;lt;/change&amp;gt;
      &amp;lt;default&amp;gt;&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For example, in the above setting, if I put &lt;CODE&gt;aa-aa&lt;/CODE&gt; in the &lt;CODE&gt;text input&lt;/CODE&gt;, the result &lt;CODE&gt;aa:aa&lt;/CODE&gt; should be substituted in the token &lt;CODE&gt;arg&lt;/CODE&gt;, but only the value &lt;CODE&gt;:&lt;/CODE&gt; is substituted.&lt;/P&gt;

&lt;P&gt;Should I do something like escape etc?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2019 08:13:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/The-quot-replace-quot-function-does-not-work-well-in-the-element/m-p/457736#M129268</guid>
      <dc:creator>yutaka1005</dc:creator>
      <dc:date>2019-03-28T08:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: The "replace" function does not work well in the  element of EventHandler.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/The-quot-replace-quot-function-does-not-work-well-in-the-element/m-p/457737#M129269</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
    &amp;lt;fieldset submitButton="false" autoRun="false"&amp;gt;
     &amp;lt;input type="text" token="text" searchWhenChanged="true"&amp;gt;
       &amp;lt;label&amp;gt;field1&amp;lt;/label&amp;gt;
       &amp;lt;change&amp;gt;
         &amp;lt;eval token="form.arg"&amp;gt;replace($text$,"(\w)-(\w)","\1:\2")&amp;lt;/eval&amp;gt;
       &amp;lt;/change&amp;gt;
       &amp;lt;default&amp;gt;&amp;lt;/default&amp;gt;
     &amp;lt;/input&amp;gt;
       &amp;lt;input type="text" token="arg" searchWhenChanged="true"/&amp;gt;
   &amp;lt;/fieldset&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Mar 2019 08:30:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/The-quot-replace-quot-function-does-not-work-well-in-the-element/m-p/457737#M129269</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-03-28T08:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: The "replace" function does not work well in the  element of EventHandler.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/The-quot-replace-quot-function-does-not-work-well-in-the-element/m-p/457738#M129270</link>
      <description>&lt;P&gt;Thank you for answer!&lt;/P&gt;

&lt;P&gt;I can solve it by this solution.&lt;BR /&gt;
But I can't do by below settings. It's weird...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;eval token="form.arg"&amp;gt;replace($text$,"(\w{2})-(\w{2})","\1:\2")&amp;lt;/eval&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Mar 2019 09:41:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/The-quot-replace-quot-function-does-not-work-well-in-the-element/m-p/457738#M129270</guid>
      <dc:creator>yutaka1005</dc:creator>
      <dc:date>2019-03-28T09:41:57Z</dc:date>
    </item>
  </channel>
</rss>

