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!

Announcing Scheduled Export GA for Dashboard Studio

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

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...