Splunk Search

How to use xml cdata tag for not displaying characters?

jip31
Motivator

hi

I  use a "link to the search" drilldown from a table panel 

When I have a look to my xml, I have a lot of special characters

 

 

<drilldown>
          <link target="_blank">search?q=%60index_mesuresc%60%20sourcetype%3D%22ez%3Acitrix%22&amp;earliest=&amp;latest=</link>
        </drilldown>

 

 

 as far as I know, we can use cdata to correct this?

so I dont know how to use cdata tag for not displaying characters

I have tried this but it doesnt works

 

 

<drilldown>
<link target="_blank"><![CDATA[search?q=%60index_mesuresc%60%20sourcetype%3D%22ez%3Acitrix%22&amp;earliest=&amp;latest=]]></link>
</drilldown>

 

 

Could you help please?

Tags (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

The link is a URL and has to be encoded as such, for example, spaces are encoded as %20. This is standard for URLs. The URL is "displayed" by the browser in the address bar. Further to this, the string has to be further encoded as the dashboard is SimpleXML, for example, ampersands as encoded as &amp;. This is also standard for XML. Since you have already confirmed that this works, I would go with a functioning solution if I were you.

View solution in original post

0 Karma

jip31
Motivator

Is anybody can help please?

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

What needs "correcting"? Does this link not work?

0 Karma

jip31
Motivator

This URL works but I thought that using cdata tags the URL will be displayed without spécial characters

It seems to not be the case?

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

The link is a URL and has to be encoded as such, for example, spaces are encoded as %20. This is standard for URLs. The URL is "displayed" by the browser in the address bar. Further to this, the string has to be further encoded as the dashboard is SimpleXML, for example, ampersands as encoded as &amp;. This is also standard for XML. Since you have already confirmed that this works, I would go with a functioning solution if I were you.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...