<?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 XML dashboard - modify a token using replace and regex in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/XML-dashboard-modify-a-token-using-replace-and-regex/m-p/528523#M35873</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I'm trying to repeat the example for &lt;EM&gt;replace&lt;/EM&gt; in the Splunk documentation, within a dashboard: (&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/8.1.2009/SearchReference/TextFunctions" target="_blank"&gt;https://docs.splunk.com/Documentation/SplunkCloud/8.1.2009/SearchReference/TextFunctions&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;I'm running this in a dashboard, triggered by a drilldown:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;drilldown&amp;gt;
 &amp;lt;eval token="p1_ttr_left"&amp;gt;replace("1/14/2017", "^(\d{1,2})/(\d{1,2})/", "\2/\1/")&amp;lt;/eval&amp;gt;
&amp;lt;/drilldown&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It doesn't seem to work, nothing happens to the token (I'm writing it to the dashboard output).&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Nov 2020 12:38:01 GMT</pubDate>
    <dc:creator>BernardEAI</dc:creator>
    <dc:date>2020-11-09T12:38:01Z</dc:date>
    <item>
      <title>XML dashboard - modify a token using replace and regex</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/XML-dashboard-modify-a-token-using-replace-and-regex/m-p/528523#M35873</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I'm trying to repeat the example for &lt;EM&gt;replace&lt;/EM&gt; in the Splunk documentation, within a dashboard: (&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/8.1.2009/SearchReference/TextFunctions" target="_blank"&gt;https://docs.splunk.com/Documentation/SplunkCloud/8.1.2009/SearchReference/TextFunctions&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;I'm running this in a dashboard, triggered by a drilldown:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;drilldown&amp;gt;
 &amp;lt;eval token="p1_ttr_left"&amp;gt;replace("1/14/2017", "^(\d{1,2})/(\d{1,2})/", "\2/\1/")&amp;lt;/eval&amp;gt;
&amp;lt;/drilldown&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It doesn't seem to work, nothing happens to the token (I'm writing it to the dashboard output).&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2020 12:38:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/XML-dashboard-modify-a-token-using-replace-and-regex/m-p/528523#M35873</guid>
      <dc:creator>BernardEAI</dc:creator>
      <dc:date>2020-11-09T12:38:01Z</dc:date>
    </item>
    <item>
      <title>Re: XML dashboard - modify a token using replace and regex</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/XML-dashboard-modify-a-token-using-replace-and-regex/m-p/528554#M35879</link>
      <description>&lt;P&gt;The slashes need to be escaped.&amp;nbsp; Try&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;eval token="p1_ttr_left"&amp;gt;replace("1/14/2017", "^(\d{1,2})\/(\d{1,2})\/", "\2/\1/")&amp;lt;/eval&amp;gt;&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 09 Nov 2020 16:58:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/XML-dashboard-modify-a-token-using-replace-and-regex/m-p/528554#M35879</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-11-09T16:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: XML dashboard - modify a token using replace and regex</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/XML-dashboard-modify-a-token-using-replace-and-regex/m-p/528777#M35886</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;. This didn't work, still not replacing the token. In fact, the token remains as&amp;nbsp;&lt;/P&gt;&lt;P&gt;$p1_ttr_left$ in the dashboard.&lt;/P&gt;&lt;P&gt;If I run the following as a test, it seems to work and it performs the replace on the string and returns the token.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;eval token="p1_ttr_left"&amp;gt;replace("www,aaa","^(.+?),","")&amp;lt;/eval&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;It looks to me like some forms of regex is accepted, but other (specifically if it includes a \..?) doesn't work.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Nov 2020 05:46:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/XML-dashboard-modify-a-token-using-replace-and-regex/m-p/528777#M35886</guid>
      <dc:creator>BernardEAI</dc:creator>
      <dc:date>2020-11-10T05:46:20Z</dc:date>
    </item>
  </channel>
</rss>

