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!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...