Dashboards & Visualizations

How to make splunk not treating the value in drilldown link as a relative path.

lionel319
Explorer

I'm trying to do a drilldown so that when user clicked on a column of a table, it will open up a new page

<drilldown>
    <link>
        $click.value2
    </link>
</drilldown>

The value of $click.value2$ is http://www.google.com.

Somehow, when the cell is clicked, splunk treats it as a relative path, and brings me to:-

http://my/splunk/instant/apps/http://www.google.com

Is there anyway to workaround this?

Tags (1)
0 Karma
1 Solution

lionel319
Explorer

Ok. I managed to get it to work. This is what i did:-

Convert the dashboard into HTML, and then

Modify this line

 // var url = TokenUtils.replaceTokenNames("{{SPLUNKWEB_URL_PREFIX}}/app/lionel/$click.value2$", _.extend(submittedTokenModel.toJSON(), e.data), TokenUtils.getEscaper('url'));

... to this:-

var url = TokenUtils.replaceTokenNames("$click.value2$", _.extend(submittedTokenModel.toJSON(), e.data));

View solution in original post

0 Karma

lionel319
Explorer

Ok. I managed to get it to work. This is what i did:-

Convert the dashboard into HTML, and then

Modify this line

 // var url = TokenUtils.replaceTokenNames("{{SPLUNKWEB_URL_PREFIX}}/app/lionel/$click.value2$", _.extend(submittedTokenModel.toJSON(), e.data), TokenUtils.getEscaper('url'));

... to this:-

var url = TokenUtils.replaceTokenNames("$click.value2$", _.extend(submittedTokenModel.toJSON(), e.data));
0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...