<?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: Simple XML: How to display search results within an HTML List? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Simple-XML-How-to-display-search-results-within-an-HTML-List/m-p/224092#M13906</link>
    <description>&lt;P&gt;Awesome!! Really glad this worked for you.&lt;/P&gt;</description>
    <pubDate>Wed, 11 Nov 2015 22:45:45 GMT</pubDate>
    <dc:creator>frobinson_splun</dc:creator>
    <dc:date>2015-11-11T22:45:45Z</dc:date>
    <item>
      <title>Simple XML: How to display search results within an HTML List?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Simple-XML-How-to-display-search-results-within-an-HTML-List/m-p/224089#M13903</link>
      <description>&lt;P&gt;I'm looking to see if there's a solution to display a search result (1 event) using Simple XML. Is there a token that needs to be set for each return field? I'm using Splunk 6.3 &lt;/P&gt;

&lt;P&gt;In the required js stack, I noticed the ListElement, but there's isn't much documentation on this. Ideally I would like to display the results within HTML tags, however, alternatives are certainly welcomed. &lt;/P&gt;

&lt;P&gt;I would like to display the results like the sudo code below&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;row&amp;gt;
&amp;lt;panel&amp;gt;
&amp;lt;html&amp;gt;

FirstName: $result.fname$
LastName: $result.lname$
Email: $result.email$

&amp;lt;/html&amp;gt;
&amp;lt;/panel&amp;gt;
&amp;lt;/row&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 10 Nov 2015 22:21:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Simple-XML-How-to-display-search-results-within-an-HTML-List/m-p/224089#M13903</guid>
      <dc:creator>dc595</dc:creator>
      <dc:date>2015-11-10T22:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: Simple XML: How to display search results within an HTML List?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Simple-XML-How-to-display-search-results-within-an-HTML-List/m-p/224090#M13904</link>
      <description>&lt;P&gt;Hi @dc595,&lt;BR /&gt;
You might want to try using search tokens. You can use search tokens to access job metadata or information from the first results row returned.&lt;/P&gt;

&lt;P&gt;Here is some documentation about working with search tokens:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.1/Viz/tokens#Define_search_tokens"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.1/Viz/tokens#Define_search_tokens&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You can also take a look at the Dashboard Examples app to see examples of using tokens with HTML (in particular, the "Custom Token Definitions" example):&lt;BR /&gt;
&lt;A href="https://splunkbase.splunk.com/app/1603/"&gt;https://splunkbase.splunk.com/app/1603/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps! Let me know if you need other suggestions.&lt;/P&gt;

&lt;P&gt;@frobinson_splunk&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2015 01:00:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Simple-XML-How-to-display-search-results-within-an-HTML-List/m-p/224090#M13904</guid>
      <dc:creator>frobinson_splun</dc:creator>
      <dc:date>2015-11-11T01:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: Simple XML: How to display search results within an HTML List?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Simple-XML-How-to-display-search-results-within-an-HTML-List/m-p/224091#M13905</link>
      <description>&lt;P&gt;Yes it does help - I just successfully  finished testing a panel with your suggestion.  Thank you for your help&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2015 22:29:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Simple-XML-How-to-display-search-results-within-an-HTML-List/m-p/224091#M13905</guid>
      <dc:creator>dc595</dc:creator>
      <dc:date>2015-11-11T22:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: Simple XML: How to display search results within an HTML List?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Simple-XML-How-to-display-search-results-within-an-HTML-List/m-p/224092#M13906</link>
      <description>&lt;P&gt;Awesome!! Really glad this worked for you.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2015 22:45:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Simple-XML-How-to-display-search-results-within-an-HTML-List/m-p/224092#M13906</guid>
      <dc:creator>frobinson_splun</dc:creator>
      <dc:date>2015-11-11T22:45:45Z</dc:date>
    </item>
    <item>
      <title>Re: Simple XML: How to display search results within an HTML List?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Simple-XML-How-to-display-search-results-within-an-HTML-List/m-p/224093#M13907</link>
      <description>&lt;P&gt;I'd agree with using search tokens. Here is something really simple but works.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;search&amp;gt;
   &amp;lt;query&amp;gt;|inputlookup In_progress.csv | eval Answer="In Progress" | table Answer&amp;lt;/query&amp;gt;
   &amp;lt;earliest&amp;gt;-1s@s&amp;lt;/earliest&amp;gt;
   &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
   &amp;lt;finalized&amp;gt;
      &amp;lt;set token="ThisIsMyToken"&amp;gt;$result.Answer$&amp;lt;/set&amp;gt;
   &amp;lt;/finalized&amp;gt;
&amp;lt;/search&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will put the value "&lt;STRONG&gt;In Progress&lt;/STRONG&gt;" into the token &lt;CODE&gt;$ThisIsMyToken$&lt;/CODE&gt; which we can use in a panel down below.&lt;/P&gt;

&lt;P&gt;The token is generated after the query completes, which is why I used a simple inputlookup to do this, and did not bother to collect anything from the .csv file&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;row&amp;gt;
   &amp;lt;panel&amp;gt;
      &amp;lt;html&amp;gt;
         &amp;lt;p style="text-align:center; font-size:400%; color: #000000"&amp;gt;
            Current Status  

            &amp;lt;div style="color: #73a550"&amp;gt;
            $ThisIsMyToken$
            &amp;lt;/div&amp;gt;
         &amp;lt;/p&amp;gt;
      &amp;lt;/html&amp;gt;
   &amp;lt;/panel&amp;gt;
   &amp;lt;panel&amp;gt;
      &amp;lt;!-- more content goes here, if needed --&amp;gt;
   &amp;lt;/panel&amp;gt;
   &amp;lt;panel&amp;gt;
      &amp;lt;!-- and even more content goes here, but only if needed --&amp;gt;
   &amp;lt;/panel&amp;gt;
&amp;lt;/row&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The first panel should only display two lines "&lt;STRONG&gt;Current Status&lt;/STRONG&gt;" in black, and "&lt;STRONG&gt;In Progress&lt;/STRONG&gt;" in green, but both in a larger font size, and centered in the panel.&lt;/P&gt;

&lt;P&gt;You could also put a &amp;lt;table&amp;gt; and &amp;lt;/table&amp;gt; in between the &amp;lt;html&amp;gt; and &amp;lt;/html&amp;gt; objects if you needed to integrate more values in a table structure.&lt;/P&gt;

&lt;P&gt;I hope this helps.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2015 16:30:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Simple-XML-How-to-display-search-results-within-an-HTML-List/m-p/224093#M13907</guid>
      <dc:creator>ArthurGautesen</dc:creator>
      <dc:date>2015-11-17T16:30:59Z</dc:date>
    </item>
  </channel>
</rss>

