Dashboards & Visualizations

Is there a URL Prefix variable in Simple XML?

jamesvz84
Communicator

Hello,

I am trying to link to a python controller from a simple xml html panel. I want to get the URL prefix, http://localhost:8000/, dynamically and not have to hard code it. In simple xml, is there a variable for the URL prefix (similar to {{SPLUNKWEB_URL_PREFIX}} in javascript)?

    <form>
    ....
  <row>
    <panel>
     <html> <a href="http://localhost:8000/en-US/custom/test_app/testcontroller">Link to controller</a>   </html>
    ...
  </panel>  
  </row>
    </form>
0 Karma

LukeMurphey
Champion

I would recommend switching to a relative path. That way, the view will work even if the server IP or port changes, if it uses a different language, or a custom root endpoint.

Below is a modified version that should work for you:

    <form>
  ...
  <row>
    <panel>
     <html> <a href="/custom/test_app/testcontroller">Link to controller</a>   </html>
 ...
  </panel>  
  </row>
    </form>

markthompson
Builder

I totally agree, in this day and age, no link should be hard coded, all should use a relative path. Browsers are now intelligent enough to detect that all you want to do is use the same root URL but with a different path on the end.

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