All Apps and Add-ons

Opening a drilldown link

viggor
Path Finder

This has been asked before, I carefully checked all the replies but none of them work.

Simple question:
I have a table with urls, i.e., strings of the form http://foo.com, and I would like, in Splunk 6.5.1, to have the website redirect to http://foo.com when clicked.

Note:

 <drilldown>
   <eval token="u">replace($click.value2$, "http://", ""</eval>
   <link> ![CDATA[http://$u$]]</link>   
 </drilldown>

does not work, even when CDATA is removed.

0 Karma

worshamn
Contributor

If you use the special '|n' after the token, it turns off character escaping and then it should work and that way you don't have to know beforehand if it is https or http:

<drilldown>
     <link target="_blank">$row.link|n$</link>
</drilldown>

http://docs.splunk.com/Documentation/Splunk/latest/Viz/tokens
Though what is amusing is the documenation also shows a '|u' which you would think whould be used here in this instance but I can only get it to work with '|n'

jason_hotchkiss
Communicator

Thank you for this - this worked for me!

0 Karma

jeffland
SplunkTrust
SplunkTrust

For me, this works fine:

<dashboard>
  <label>_temp drilldown to url</label>
  <row>
    <panel>
      <table>
        <search>
          <query>| makeresults | eval url="http://google.com"</query>
          <earliest>0</earliest>
          <latest></latest>
        </search>
        <drilldown>
          <eval token="u">replace($row.url$, "http://", "")</eval>
          <link target="_blank">
            http://$u$
          </link>
        </drilldown>
      </table>
    </panel>
  </row>
</dashboard>

I don't see why it wouldn't. You should either use $row.url$ (or whichever column contains your url) so that each click inside a row uses the value of that column, or you should limit the drilldown link to clicks on that column with a condition like this:

<dashboard>
  <label>_temp drilldown to url</label>
  <row>
    <panel>
      <table>
        <search>
          <query>| makeresults | eval url="http://google.com"</query>
          <earliest>0</earliest>
          <latest></latest>
        </search>
        <drilldown>
          <condition field="url">
            <eval token="u">replace($click.value2$, "http://", "")</eval>
            <link target="_blank">
              http://$u$
            </link>
          <condition>
        </drilldown>
      </table>
    </panel>
  </row>
</dashboard>

sbbadri
Motivator

try like below,

<drilldown>
<eval token="u">replace($row.fieldnamefromtableforurl$, "http://", "")</eval>

<![CDATA[ http://$u$ ]]>

</drilldown>

0 Karma

viggor
Path Finder

Thanks for your answer, I tried your approach but it does not make the table entries clickable, I guess it might be a syntax error.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...