Dashboards & Visualizations

Splunk Simple XML : Invalid character entry in XML help with CDATA in href

Super Champion

hi UI gurus,
we have a simple requirement to display certain links in a dashboard. All is good until there is invalid (un-encoded) characters involved. then if I use [[CDATA]] then Splunk simple XML takes the values as literal

Below is dashboard we want to achieve

  <label>test HREF CDATA</label>
                HREF test with un-encoded characters
            <li>Lookup Links
                    <li>My Lookup => 
                    <a href="../lookup_editor/owner=nobody&namespace=search&lookup=xyz.csv&type=csv">Link</a>

Since the href is "un-encoded", this complains. When we change the <a> link as below

<![CDATA[<a href="../lookup_editor/owner=nobody&namespace=search&lookup=xyz.csv&type=csv">Link</a>]]> 

Then splunk XML does not render href properly.
What's the best way to use "href" links properly in Simple XML?

PS: Even <link> don't like & in the URL as below also have same problem



0 Karma

Ultra Champion

how about $url|u$?

      <set token="a_link">$click.value2$</set>
       <eval token="url">trim(mvindex(split($a_link$,"("),1),")")</eval>
       <link target="_blank">
         <![CDATA[ https://httpbin.org/json ]]></link>

this works

0 Karma

Super Champion

Got the gist of the logic. Thanks again. If you want to put as answer, will mark as "answer"

0 Karma

Super Champion

but in the above, where are we passing the "token" to the link URL?

0 Karma

Ultra Champion

If you write statically, you only have to convert this problem when writing it, right?

0 Karma
Get Updates on the Splunk Community!

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

March Community Office Hours Security Series Uncovered!

Hello Splunk Community! In March, Splunk Community Office Hours spotlighted our fabulous Splunk Threat ...

Stay Connected: Your Guide to April Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars in April. This post ...