Dashboards & Visualizations

How do I create a hyperlink from a field that contains slashes?

srmadsen
Engager

I have a field in a dashboard named 'pom_dir' that contains a path (e.g., 'repo/dir'). I've added the following to my dashboard source:

<drilldown>
  <link>https://github.com/org/$row.pom_dir$/blob/master/pom.xml</link>
</drilldown>

Looks like it should work, but when I click on the link, the result is:

https://github.com/org/repo%2Fdir/blob/master/pom.xml

All the slashes in the field are replaced with %2F

How do I work around this?

somesoni2
Revered Legend

Give this a try. This ( |n) is to ensure, the token values are not URL encoded.

<drilldown>
   <link>https://github.com/org/$row.pom_dir|n$/blob/master/pom.xml</link>
 </drilldown>
0 Karma

srmadsen
Engager

Sorry, your suggestion did not work. The resulting URL looks like:
https://github.com/fs-eng/$row.pom_dir%7Cn$/blob/master/pom.xml
No substitution is performed and '%7Cn' is injected.

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!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

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