<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SimpleXML HTML tokens in HTML tag in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/SimpleXML-HTML-tokens-in-HTML-tag/m-p/323324#M20853</link>
    <description>&lt;P&gt;@fk319, From your question it is not crystal clear as to what you have and what you are trying to accomplish. However, if your goal is to set HTML in SPL and pass on to a &lt;CODE&gt;&amp;lt;html&amp;gt;&lt;/CODE&gt; panel you can refer to the following answer by me with Simple XML JavaScript Extension: &lt;A href="https://answers.splunk.com/answers/324828/render-html-code-from-search-result-in-splunk-dash.html"&gt;https://answers.splunk.com/answers/324828/render-html-code-from-search-result-in-splunk-dash.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Please try out and confirm. If this is not what you need please elaborate with what you current have and mock up/details for what you need.&lt;/P&gt;</description>
    <pubDate>Sun, 08 Apr 2018 17:41:11 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2018-04-08T17:41:11Z</dc:date>
    <item>
      <title>SimpleXML HTML tokens in HTML tag</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/SimpleXML-HTML-tokens-in-HTML-tag/m-p/323323#M20852</link>
      <description>&lt;P&gt;I would like to create HTML code in my Splunk search and display it in an HTML section.&lt;BR /&gt;
The problem I have is the interpreter presents my html as characters and not as tags.&lt;/P&gt;

&lt;P&gt;In my current case, I have a series of image I would like to display, about 40.  I can create the 40 &lt;EM&gt;set token&lt;/EM&gt; in my SimpleXML, but it is so much easier to build it in the query.  In the past I would have 1-3 images I wanted to display, but ended up only showing the first.&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
|eval html=""&lt;BR /&gt;
&lt;/PRE&gt;&lt;BR /&gt;
gets displayed as the string.&lt;BR /&gt;
I solved this by just passing&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
$result.icon$&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt; &lt;BR /&gt;
Internally I have a multivalue field that has a list of icons, I would convert each to html and then join them up and pass as a single string.  I just do not know how to display them as the intended tags instead of the string of characters.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Apr 2018 16:19:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/SimpleXML-HTML-tokens-in-HTML-tag/m-p/323323#M20852</guid>
      <dc:creator>fk319</dc:creator>
      <dc:date>2018-04-08T16:19:03Z</dc:date>
    </item>
    <item>
      <title>Re: SimpleXML HTML tokens in HTML tag</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/SimpleXML-HTML-tokens-in-HTML-tag/m-p/323324#M20853</link>
      <description>&lt;P&gt;@fk319, From your question it is not crystal clear as to what you have and what you are trying to accomplish. However, if your goal is to set HTML in SPL and pass on to a &lt;CODE&gt;&amp;lt;html&amp;gt;&lt;/CODE&gt; panel you can refer to the following answer by me with Simple XML JavaScript Extension: &lt;A href="https://answers.splunk.com/answers/324828/render-html-code-from-search-result-in-splunk-dash.html"&gt;https://answers.splunk.com/answers/324828/render-html-code-from-search-result-in-splunk-dash.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Please try out and confirm. If this is not what you need please elaborate with what you current have and mock up/details for what you need.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Apr 2018 17:41:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/SimpleXML-HTML-tokens-in-HTML-tag/m-p/323324#M20853</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-04-08T17:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: SimpleXML HTML tokens in HTML tag</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/SimpleXML-HTML-tokens-in-HTML-tag/m-p/323325#M20854</link>
      <description>&lt;P&gt;I did google search before I posted, really I did.&lt;BR /&gt;
I like the solution.  I will get the changed implemented in a few days.  I am in documentation mode at the moment.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Apr 2018 20:20:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/SimpleXML-HTML-tokens-in-HTML-tag/m-p/323325#M20854</guid>
      <dc:creator>fk319</dc:creator>
      <dc:date>2018-04-08T20:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: SimpleXML HTML tokens in HTML tag</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/SimpleXML-HTML-tokens-in-HTML-tag/m-p/323326#M20855</link>
      <description>&lt;P&gt;I see what you are doing, but I need to do a js for each token I want to convert.&lt;BR /&gt;
Is there a way I could do something more general? even if I could pas the id?&lt;/P&gt;</description>
      <pubDate>Sun, 08 Apr 2018 20:43:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/SimpleXML-HTML-tokens-in-HTML-tag/m-p/323326#M20855</guid>
      <dc:creator>fk319</dc:creator>
      <dc:date>2018-04-08T20:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: SimpleXML HTML tokens in HTML tag</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/SimpleXML-HTML-tokens-in-HTML-tag/m-p/323327#M20856</link>
      <description>&lt;P&gt;The Submitted Token object itself will have all the tokens available which you can iterate in a loop using &lt;CODE&gt;JSON parse()&lt;/CODE&gt; method. However, before you even try that, I am unclear on your requirement. Can you please add more details/example or mock up screen for what you have and what you intend to implement?&lt;/P&gt;</description>
      <pubDate>Mon, 09 Apr 2018 04:06:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/SimpleXML-HTML-tokens-in-HTML-tag/m-p/323327#M20856</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-04-09T04:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: SimpleXML HTML tokens in HTML tag</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/SimpleXML-HTML-tokens-in-HTML-tag/m-p/323328#M20857</link>
      <description>&lt;P&gt;There is no straight away solution for your requirement,&lt;BR /&gt;
But you can achieve it via by adding some javascript with your token.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var defaultTokenModel = mvc.Components.get("default");
defaultTokenModel .on("change:your_token_name", function(tokenmodel, value, options ){
   /*
       Here based on your value you can construct your HTML and update the document
   */
})
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You cannot use inline javscript inside splunk xml. you have to follow &lt;A href="http://dev.splunk.com/view/webframework-developapps/SP-CAAAE4A"&gt;this doc&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Apr 2018 06:58:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/SimpleXML-HTML-tokens-in-HTML-tag/m-p/323328#M20857</guid>
      <dc:creator>paramagurukarth</dc:creator>
      <dc:date>2018-04-09T06:58:42Z</dc:date>
    </item>
  </channel>
</rss>

