<?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: Can we display search results in HTML tags using Splunk version 6.x? in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Can-we-display-search-results-in-HTML-tags-using-Splunk-version/m-p/218426#M23824</link>
    <description>&lt;P&gt;Following are some of common search tokens:&lt;/P&gt;

&lt;P&gt;Job Metadata&lt;BR /&gt;
$job.earliestTime$ - Initial time a search job starts&lt;BR /&gt;
$job.latestTime$ - Latest time recorded for the search job&lt;BR /&gt;
&lt;STRONG&gt;$job.resultCount$&lt;/STRONG&gt; - Number of results returned by the search job&lt;BR /&gt;
$job.runDuration$ - Time, in seconds, that the search took to complete&lt;BR /&gt;
$job.messages$ - List of error and debug messages generated by the search job&lt;/P&gt;

&lt;P&gt;Search Results (&lt;STRONG&gt;first result only&lt;/STRONG&gt;)&lt;BR /&gt;
&lt;STRONG&gt;$result.[fieldName]$&lt;/STRONG&gt; - Results are referenced directly by their field name.&lt;/P&gt;

&lt;P&gt;Refer to &lt;STRONG&gt;Search Result Setter&lt;/STRONG&gt; example on the &lt;STRONG&gt;Splunk 6.x Dashboard Example App&lt;/STRONG&gt;.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;search&amp;gt;
      &amp;lt;query&amp;gt;index=_internal |  top sourcetype&amp;lt;/query&amp;gt;
      &amp;lt;earliest&amp;gt;-60m&amp;lt;/earliest&amp;gt;
      &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
      &amp;lt;!-- Use the following search events to access job properties, and set tokens that can be accessible throughout the page --&amp;gt;
      &amp;lt;!-- Progress event has access to job properties only (not first result row) --&amp;gt;
      &amp;lt;progress&amp;gt;
        &amp;lt;set token="sourcetype_count"&amp;gt;$job.resultCount$&amp;lt;/set&amp;gt;
      &amp;lt;/progress&amp;gt;
      &amp;lt;cancelled&amp;gt;
        &amp;lt;unset token="sourcetype_count"&amp;gt;&amp;lt;/unset&amp;gt;
      &amp;lt;/cancelled&amp;gt;
    &amp;lt;/search&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also for using HTML Panels in Splunk Dashboard refer to &lt;STRONG&gt;Null Search Swapper&lt;/STRONG&gt; example. Following is a snippet from the same&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;html depends="$show_html$"&amp;gt;
     &amp;lt;p style="color:blue;margin-left:30px;font-size:14px"&amp;gt;Search returned no results, so we've hidden the chart!&amp;lt;/p&amp;gt;
  &amp;lt;/html&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 04 Jan 2017 20:07:17 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2017-01-04T20:07:17Z</dc:date>
    <item>
      <title>Can we display search results in HTML tags using Splunk version 6.x?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Can-we-display-search-results-in-HTML-tags-using-Splunk-version/m-p/218425#M23823</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;In Splunk older versions, there is a concept of distributing the Splunk search results in HTML modules, or HTML tags using the &lt;STRONG&gt;results&lt;/STRONG&gt; token. i.e. &lt;STRONG&gt;results[0].fieldname&lt;/STRONG&gt; etc.&lt;/P&gt;

&lt;P&gt;In Splunk 6.x version do we have any examples of getting the same functionality?&lt;/P&gt;

&lt;P&gt;My older sample code in Splunk 5.x version:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;module name="HiddenSearch" layoutPanel="panel_row1_col1_grp1" autoRun="True"&amp;gt;
          &amp;lt;param name="search"&amp;gt;index=_internal | stats count &amp;lt;/param&amp;gt;
          &amp;lt;module name="HTML" layoutPanel="panel_row5_col1_grp1"&amp;gt;
            &amp;lt;param name="html"&amp;gt;
              &amp;lt;div&amp;gt; Search Results : $results.count$ &amp;lt;/div&amp;gt;
            &amp;lt;/param&amp;gt;
          &amp;lt;/module&amp;gt;
        &amp;lt;/module&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can we have something similar for Splunk 6.x version ??&lt;/P&gt;

&lt;P&gt;thanks,&lt;BR /&gt;
Rakesh,.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2017 11:26:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Can-we-display-search-results-in-HTML-tags-using-Splunk-version/m-p/218425#M23823</guid>
      <dc:creator>rakesh_498115</dc:creator>
      <dc:date>2017-01-04T11:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: Can we display search results in HTML tags using Splunk version 6.x?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Can-we-display-search-results-in-HTML-tags-using-Splunk-version/m-p/218426#M23824</link>
      <description>&lt;P&gt;Following are some of common search tokens:&lt;/P&gt;

&lt;P&gt;Job Metadata&lt;BR /&gt;
$job.earliestTime$ - Initial time a search job starts&lt;BR /&gt;
$job.latestTime$ - Latest time recorded for the search job&lt;BR /&gt;
&lt;STRONG&gt;$job.resultCount$&lt;/STRONG&gt; - Number of results returned by the search job&lt;BR /&gt;
$job.runDuration$ - Time, in seconds, that the search took to complete&lt;BR /&gt;
$job.messages$ - List of error and debug messages generated by the search job&lt;/P&gt;

&lt;P&gt;Search Results (&lt;STRONG&gt;first result only&lt;/STRONG&gt;)&lt;BR /&gt;
&lt;STRONG&gt;$result.[fieldName]$&lt;/STRONG&gt; - Results are referenced directly by their field name.&lt;/P&gt;

&lt;P&gt;Refer to &lt;STRONG&gt;Search Result Setter&lt;/STRONG&gt; example on the &lt;STRONG&gt;Splunk 6.x Dashboard Example App&lt;/STRONG&gt;.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;search&amp;gt;
      &amp;lt;query&amp;gt;index=_internal |  top sourcetype&amp;lt;/query&amp;gt;
      &amp;lt;earliest&amp;gt;-60m&amp;lt;/earliest&amp;gt;
      &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
      &amp;lt;!-- Use the following search events to access job properties, and set tokens that can be accessible throughout the page --&amp;gt;
      &amp;lt;!-- Progress event has access to job properties only (not first result row) --&amp;gt;
      &amp;lt;progress&amp;gt;
        &amp;lt;set token="sourcetype_count"&amp;gt;$job.resultCount$&amp;lt;/set&amp;gt;
      &amp;lt;/progress&amp;gt;
      &amp;lt;cancelled&amp;gt;
        &amp;lt;unset token="sourcetype_count"&amp;gt;&amp;lt;/unset&amp;gt;
      &amp;lt;/cancelled&amp;gt;
    &amp;lt;/search&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also for using HTML Panels in Splunk Dashboard refer to &lt;STRONG&gt;Null Search Swapper&lt;/STRONG&gt; example. Following is a snippet from the same&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;html depends="$show_html$"&amp;gt;
     &amp;lt;p style="color:blue;margin-left:30px;font-size:14px"&amp;gt;Search returned no results, so we've hidden the chart!&amp;lt;/p&amp;gt;
  &amp;lt;/html&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Jan 2017 20:07:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Can-we-display-search-results-in-HTML-tags-using-Splunk-version/m-p/218426#M23824</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-01-04T20:07:17Z</dc:date>
    </item>
    <item>
      <title>Re: Can we display search results in HTML tags using Splunk version 6.x?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Can-we-display-search-results-in-HTML-tags-using-Splunk-version/m-p/218427#M23825</link>
      <description>&lt;P&gt;Hi Niketnilay,&lt;/P&gt;

&lt;P&gt;thanks for your reply. from the above code its show to refer to the first row of the results , how can we refer to the second row of the results ??&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Search Results (first result only)
$result.[fieldName]$ - Results are referenced directly by their field name.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is there any way to refer to the second row and so on...&lt;/P&gt;

&lt;P&gt;many thanks,&lt;BR /&gt;
Rakesh.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 08:05:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Can-we-display-search-results-in-HTML-tags-using-Splunk-version/m-p/218427#M23825</guid>
      <dc:creator>rakesh_498115</dc:creator>
      <dc:date>2017-01-05T08:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: Can we display search results in HTML tags using Splunk version 6.x?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Can-we-display-search-results-in-HTML-tags-using-Splunk-version/m-p/218428#M23826</link>
      <description>&lt;P&gt;Hi Niketnilay,&lt;/P&gt;

&lt;P&gt;thanks for your reply. from the above code its show to refer to the first row of the results , how can we refer to the second row of the results ??&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Search Results (first result only)
$result.[fieldName]$ - Results are referenced directly by their field name.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is there any way to refer to the second row and so on...&lt;/P&gt;

&lt;P&gt;many thanks,&lt;BR /&gt;
Rakesh.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 08:05:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Can-we-display-search-results-in-HTML-tags-using-Splunk-version/m-p/218428#M23826</guid>
      <dc:creator>rakesh_498115</dc:creator>
      <dc:date>2017-01-05T08:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: Can we display search results in HTML tags using Splunk version 6.x?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Can-we-display-search-results-in-HTML-tags-using-Splunk-version/m-p/218429#M23827</link>
      <description>&lt;P&gt;I don't think there is way through Simple XML. You can do it either through SDK or JavaScript Extensions.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 08:24:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Can-we-display-search-results-in-HTML-tags-using-Splunk-version/m-p/218429#M23827</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-01-05T08:24:21Z</dc:date>
    </item>
  </channel>
</rss>

