Dashboards & Visualizations

How to use the Splunk table variable $row.hostname$ as a dynamic domain name URL in XML CDATA?

hemalalli
Explorer

How to use the Splunk table variable $row.hostname$ as hyperlink dynamic URL name in XML CDATA?
It is working, except for static URL names like "http://www.google.com" , so if I try to use the variable for the URL name it is not working. It seems like an issue with escaping the special characters. Please help

EG:

<link>
<![CDATA[
   http://$row.hostname$/ 
  ]]>
</link>
Tags (4)
0 Karma
1 Solution

hemalalli
Explorer

Thanks for the answers !

I have notice that ":" in the hostname (eg: www.domain.com:8080) is making some issue, and hence I have split-ed the server and port in the splunk query using eval and used the link as below.

http://$row.servername$:$row.port$/

It is working now 🙂

View solution in original post

0 Karma

hemalalli
Explorer

Thanks for the answers !

I have notice that ":" in the hostname (eg: www.domain.com:8080) is making some issue, and hence I have split-ed the server and port in the splunk query using eval and used the link as below.

http://$row.servername$:$row.port$/

It is working now 🙂

0 Karma

alacercogitatus
SplunkTrust
SplunkTrust

There is most likely a bug with the way the drilldowns are configured. Try removing the CDATA specification, as those might render the link to plain_text.

<link>
  http://$row.hostname$$/
</link>
0 Karma

woodcock
Esteemed Legend

Try escaping the dollar signs with another dollar sign like this:

<link>
<![CDATA[
http://$$row.hostname$$/ 
]]>
</link>
0 Karma

hemalalli
Explorer

Hi Woodcock,

Thanks for your reply
When I tried with $$row.hostname$$ , it is routing to http://%24row.hostname%24/ page

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 ...