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!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...