Dashboards & Visualizations

How do I place a hyperlink in a dashboard pdf report?

victorj405
New Member

I am creating a splunk dashboard with a few reports.
On one report (outputted as a table), I want a long url to be replaced by a short number.
When clicking that number (VIA THE PDF DASHBOARD REPORT) , I want it to go to the external url.
Placing just the url works, but it's broken cause it's to long and wont open the full URL.

I followed the following guide:
https://answers.splunk.com/answers/542437/how-can-i-show-customized-hyperlink-text-on-a-dash.html

It works while viewing the dashboard in a browser except for I still don't know how to edit the link correctly.

  <row>
    <panel>
      <html>
        <style>
        </style>
      </html>
      <table>
        <title>Report</title>
        <search ref="Report"></search>
        <fields>Name, QueueTime, FinishTime, Result, BuildId</fields>
        <option name="count">10</option>
        <option name="drilldown">cell</option>
        <drilldown target="_blank">
          <condition field="BuildId">
            <link target="_blank">
              $row.URL$          # Not working . URL is the name of the filed with the long url that I want replaced by another field with a short number
              https://google.com # Works
            </link>
          </condition>
        </drilldown>
      </table>
    </panel>
  </row>

index="reports"
| where (source LIKE "%Report%")
| eval BuildId = Id + ""
| table Name, QueueTime, FinishTime, Result
Tags (1)
0 Karma

jkat54
SplunkTrust
SplunkTrust

What is broken about the link that it is putting into the PDF?

Does the link fail to word-wrap and doesn’t fit on the page?

Or is it not a valid hyperlink you can click on?

0 Karma

victorj405
New Member

If I just add the URL itself in a table, the link is clickable in the PDF, but it's to long and the browser will only open what hasn't went to the second line. The URL field itself is correct

0 Karma

jkat54
SplunkTrust
SplunkTrust

So if I gave you a custom search command that uses bit.ly service to shorten urls, would you be interested knowing that it’s giving bit.ly all your links but providing the short url and also statistics on their usage?

It would work like this

 ... | bitly urlfield=fieldWithLongURLs | eval url = bitly_output | table url ...
0 Karma

DalJeanis
Legend

Have you verified that the url works when pasted into the browser? Perhaps it has not been constructed correctly.

0 Karma

victorj405
New Member

I tried getting the $row.URL$ to work, but it doesn't. Not sure what I am doing wrong. The generated URL field itself is correct.

0 Karma

victorj405
New Member

A powershell script gets the info and sends an html email and also sends this info into splunk. The html email's link works and looking at the dashboard in splunk on a browser, the link works.

0 Karma
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...