<?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: In a dashboard, why can't I configure a drill down with a rex command containing special characters? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/In-a-dashboard-why-can-t-I-configure-a-drill-down-with-a-rex/m-p/405354#M26561</link>
    <description>&lt;P&gt;Strange, for me this is working fine in 7.1.2&lt;/P&gt;</description>
    <pubDate>Thu, 04 Oct 2018 05:05:00 GMT</pubDate>
    <dc:creator>harsmarvania57</dc:creator>
    <dc:date>2018-10-04T05:05:00Z</dc:date>
    <item>
      <title>In a dashboard, why can't I configure a drill down with a rex command containing special characters?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/In-a-dashboard-why-can-t-I-configure-a-drill-down-with-a-rex/m-p/405348#M26555</link>
      <description>&lt;P&gt;I'm working on a dashboard, and trying to configure a drill down with a custom search.  If the custom search contains the  rex command, which includes several special characters including ?, &amp;lt;, &amp;gt;, then the drill down doesn't work. When clicking on a row in the dashboard to drill down, a new tab opens in chrome that just says about: blank, instead of opening a new tab with the Splunk search in it.&lt;/P&gt;

&lt;H2&gt;Steps to reproduce the issue&lt;/H2&gt;

&lt;P&gt;&lt;STRONG&gt;1) Create a test dashboard using the following simple XML:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;label&amp;gt;dashboard test 1&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=wineventlog | head 10 | stats count by host&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-60m@m&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;2) Configure the drilldown. Choose Link to search &amp;gt; Custom, and paste in the following query. Save everything.&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wineventlog host=$row.host$
| head 10
| rex field=Message "Domain:(?&amp;lt;domain&amp;gt;.*)"
| table domain
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note: Here is the simple XML this creates for me&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;        &amp;lt;option name="drilldown"&amp;gt;cell&amp;lt;/option&amp;gt;
        &amp;lt;drilldown&amp;gt;
          &amp;lt;link target="_blank"&amp;gt;search?q=index=wineventlog host=$row.host$
| head 10
| rex field=Message "Domain:(?&amp;lt;domain&amp;gt;.*)"
| table domain&amp;amp;amp;earliest=&amp;amp;amp;latest=&amp;lt;/link&amp;gt;
        &amp;lt;/drilldown&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;3) Click on a row in the dashboard, and observe a new tab opening that just says about:blank.&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5865i4716B8844FE61A09/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;4)  Go back and edit the drill down, and now enter the following query (I know the rex command isn't fully correct here!)&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wineventlog host=$row.host$
| head 10
| rex field=Message "Domain:(domain.*)"
| table domain
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;5) Again click on a row in the dashboard, and this time observe that a tab opens up with the splunk search.&lt;/STRONG&gt; &lt;/P&gt;

&lt;P&gt;Note that obviously there is an issue with the &lt;CODE&gt;rex&lt;/CODE&gt; command; it doesn't have everything it needs. However, my point in showing this is to provide evidence that the problem can be narrowed down to the ?, &amp;lt;, or &amp;gt; characters causing the issue where just a blank tab opens up in the browser.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5866i80C69702458DE316/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Why can't I configure a drill down, and in the custom search use the rex command with the ?, &amp;lt;, and &amp;gt; characters? Is there a way to get this to work?&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 01:21:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/In-a-dashboard-why-can-t-I-configure-a-drill-down-with-a-rex/m-p/405348#M26555</guid>
      <dc:creator>elyp</dc:creator>
      <dc:date>2018-10-03T01:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: In a dashboard, why can't I configure a drill down with a rex command containing special characters?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/In-a-dashboard-why-can-t-I-configure-a-drill-down-with-a-rex/m-p/405349#M26556</link>
      <description>&lt;P&gt;Such a well-written question!  &lt;/P&gt;

&lt;P&gt;Have you tried URL-encoding the &lt;CODE&gt;rex&lt;/CODE&gt; arguments within the drilldown ?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 11:37:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/In-a-dashboard-why-can-t-I-configure-a-drill-down-with-a-rex/m-p/405349#M26556</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-10-03T11:37:19Z</dc:date>
    </item>
    <item>
      <title>Re: In a dashboard, why can't I configure a drill down with a rex command containing special characters?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/In-a-dashboard-why-can-t-I-configure-a-drill-down-with-a-rex/m-p/405350#M26557</link>
      <description>&lt;P&gt;As @richgalloway mentioned, rex needs to be URL-encoded&lt;/P&gt;

&lt;P&gt;Try below drilldown, it is working in my lab environment&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;        &amp;lt;drilldown&amp;gt;
          &amp;lt;link target="_blank"&amp;gt;search?q=index=wineventlog host=$row.host$
 | head 10
 | rex field=Message "Domain:(%3F&amp;amp;lt;domain&amp;amp;gt;.*)"
 | table domain&amp;amp;amp;earliest=-60m@m&amp;amp;amp;latest=now&amp;lt;/link&amp;gt;
        &amp;lt;/drilldown&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Oct 2018 12:19:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/In-a-dashboard-why-can-t-I-configure-a-drill-down-with-a-rex/m-p/405350#M26557</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2018-10-03T12:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: In a dashboard, why can't I configure a drill down with a rex command containing special characters?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/In-a-dashboard-why-can-t-I-configure-a-drill-down-with-a-rex/m-p/405351#M26558</link>
      <description>&lt;P&gt;@elyp&lt;/P&gt;

&lt;P&gt;Can you please try this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
        &amp;lt;label&amp;gt;dashboard test 1&amp;lt;/label&amp;gt;
   &amp;lt;row&amp;gt;
     &amp;lt;panel&amp;gt;
       &amp;lt;table&amp;gt;
         &amp;lt;search&amp;gt;
           &amp;lt;query&amp;gt;index=_internal | head 10 | stats count by host&amp;lt;/query&amp;gt;
           &amp;lt;earliest&amp;gt;-60m@m&amp;lt;/earliest&amp;gt;
           &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
         &amp;lt;/search&amp;gt;
         &amp;lt;option name="drilldown"&amp;gt;cell&amp;lt;/option&amp;gt;
         &amp;lt;drilldown&amp;gt;
           &amp;lt;link target="_blank"&amp;gt;&amp;lt;![CDATA[ search?earliest=&amp;amp;latest=&amp;amp;q=index=wineventlog host=$row.host$ | head 10 | rex field=Message "Domain:(%3F&amp;lt;domain&amp;gt;.*)" | table domain]]&amp;gt;&amp;lt;/link&amp;gt;
         &amp;lt;/drilldown&amp;gt;
       &amp;lt;/table&amp;gt;
     &amp;lt;/panel&amp;gt;
   &amp;lt;/row&amp;gt;
     &amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Oct 2018 16:17:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/In-a-dashboard-why-can-t-I-configure-a-drill-down-with-a-rex/m-p/405351#M26558</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-10-03T16:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: In a dashboard, why can't I configure a drill down with a rex command containing special characters?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/In-a-dashboard-why-can-t-I-configure-a-drill-down-with-a-rex/m-p/405352#M26559</link>
      <description>&lt;P&gt;This worked. &lt;/P&gt;

&lt;P&gt;So you have to wrap it in CDATA....AND THEN manually url encode at least one specific special character yourself. Space, =, \ , ., &amp;lt;, &amp;gt; all don't have to be url encoded, but ? does.&lt;/P&gt;

&lt;P&gt;Does anyone know why CDATA doesn't handle this character?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 01:49:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/In-a-dashboard-why-can-t-I-configure-a-drill-down-with-a-rex/m-p/405352#M26559</guid>
      <dc:creator>elyp</dc:creator>
      <dc:date>2018-10-04T01:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: In a dashboard, why can't I configure a drill down with a rex command containing special characters?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/In-a-dashboard-why-can-t-I-configure-a-drill-down-with-a-rex/m-p/405353#M26560</link>
      <description>&lt;P&gt;This didn't work. I had to wrap it in CDATA like kamlesh_vaghela's example.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 01:49:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/In-a-dashboard-why-can-t-I-configure-a-drill-down-with-a-rex/m-p/405353#M26560</guid>
      <dc:creator>elyp</dc:creator>
      <dc:date>2018-10-04T01:49:33Z</dc:date>
    </item>
    <item>
      <title>Re: In a dashboard, why can't I configure a drill down with a rex command containing special characters?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/In-a-dashboard-why-can-t-I-configure-a-drill-down-with-a-rex/m-p/405354#M26561</link>
      <description>&lt;P&gt;Strange, for me this is working fine in 7.1.2&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 05:05:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/In-a-dashboard-why-can-t-I-configure-a-drill-down-with-a-rex/m-p/405354#M26561</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2018-10-04T05:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: In a dashboard, why can't I configure a drill down with a rex command containing special characters?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/In-a-dashboard-why-can-t-I-configure-a-drill-down-with-a-rex/m-p/405355#M26562</link>
      <description>&lt;P&gt;Some characters have special meaning in Simple XML files. To prevent the source code parser from treating them as special characters, wrap them in  tags. But I think for URL encoding you have to handle this character.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.1.3/Viz/OverviewofSimplifiedXML#Special_characters_in_XML_files"&gt;http://docs.splunk.com/Documentation/Splunk/7.1.3/Viz/OverviewofSimplifiedXML#Special_characters_in_XML_files&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2018 03:46:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/In-a-dashboard-why-can-t-I-configure-a-drill-down-with-a-rex/m-p/405355#M26562</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-10-05T03:46:56Z</dc:date>
    </item>
  </channel>
</rss>

