<?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: How to reference a dashboard token in an HTML panel? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-a-dashboard-token-in-an-HTML-panel/m-p/258212#M16234</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;| metadata type=hosts | head 1&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;preview&amp;gt;
       &amp;lt;set token="host"&amp;gt;$result.host$&amp;lt;/set&amp;gt;
     &amp;lt;/preview&amp;gt;
        &amp;lt;/search&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;html&amp;gt;
       $host|h$
       &amp;lt;/html&amp;gt;
  &amp;lt;/row&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 18 Oct 2016 19:16:55 GMT</pubDate>
    <dc:creator>cmerriman</dc:creator>
    <dc:date>2016-10-18T19:16:55Z</dc:date>
    <item>
      <title>How to reference a dashboard token in an HTML panel?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-a-dashboard-token-in-an-HTML-panel/m-p/258202#M16224</link>
      <description>&lt;P&gt;I regularly get requests for some data that I get from several searches.  The people requesting it like it formatted just so, so instead of manually formatting it each time I'd like to have my searches in a dashboard with all the needed data being sent to an html panel so I can format it correctly.&lt;/P&gt;

&lt;P&gt;Can someone please help direct me to what I'm doing wrong?  I've tried changing the table to a single value and tried various ways to set the token.&lt;/P&gt;

&lt;P&gt;Run anywhere:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard&amp;gt;
  &amp;lt;label&amp;gt;test&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;| metadata type=hosts | head 1&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;condition match="'job.isDone'"&amp;gt;
            &amp;lt;set token="MyHost"&amp;gt;$results.host$&amp;lt;/set&amp;gt;
          &amp;lt;/condition&amp;gt;
        &amp;lt;/search&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html&amp;gt;
        &amp;lt;p&amp;gt;Host: $MyHost$&amp;lt;/p&amp;gt;
      &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get back:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;firstTime   host         lastTime     recentTime   totalCount   type
1476644722   myHostName   1476736882   1476736882   154103       hosts
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and &lt;CODE&gt;Host: $MyHost$&lt;/CODE&gt; instead of &lt;CODE&gt;Host: myHostName&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2016 21:03:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-a-dashboard-token-in-an-HTML-panel/m-p/258202#M16224</guid>
      <dc:creator>ScottSusman</dc:creator>
      <dc:date>2016-10-17T21:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a dashboard token in an HTML panel?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-a-dashboard-token-in-an-HTML-panel/m-p/258203#M16225</link>
      <description>&lt;P&gt;Try like this (run anywhere sample)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard&amp;gt;
  &amp;lt;label&amp;gt;test&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=_internal | head 1 | table host sourcetype source&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;done&amp;gt;&amp;lt;set token="MyHost"&amp;gt;$result.host$&amp;lt;/set&amp;gt;&amp;lt;/done&amp;gt;
        &amp;lt;/search&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
    &amp;lt;panel depends="$MyHost$"&amp;gt;
      &amp;lt;html&amp;gt;
         &amp;lt;p&amp;gt;Host: $MyHost$&amp;lt;/p&amp;gt;
       &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 Oct 2016 21:25:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-a-dashboard-token-in-an-HTML-panel/m-p/258203#M16225</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-10-17T21:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a dashboard token in an HTML panel?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-a-dashboard-token-in-an-HTML-panel/m-p/258204#M16226</link>
      <description>&lt;P&gt;Hm... same result on Splunk at work.  Works perfect at home.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2016 23:41:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-a-dashboard-token-in-an-HTML-panel/m-p/258204#M16226</guid>
      <dc:creator>ScottSusman</dc:creator>
      <dc:date>2016-10-17T23:41:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a dashboard token in an HTML panel?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-a-dashboard-token-in-an-HTML-panel/m-p/258205#M16227</link>
      <description>&lt;P&gt;Check the token value is &lt;CODE&gt;$result.host$&lt;/CODE&gt; and not &lt;CODE&gt;$results.host$&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2016 03:18:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-a-dashboard-token-in-an-HTML-panel/m-p/258205#M16227</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-10-18T03:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a dashboard token in an HTML panel?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-a-dashboard-token-in-an-HTML-panel/m-p/258206#M16228</link>
      <description>&lt;P&gt;Yep, I'm using result now, not results.  I copy/pasted your example (I don't have access to _internal so I changed it to index=*).&lt;/P&gt;

&lt;P&gt;At work we have version 6.4.0 and at home I have 6.5.0 (both Enterprise) but I wouldn't think that would matter with something this basic.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2016 12:48:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-a-dashboard-token-in-an-HTML-panel/m-p/258206#M16228</guid>
      <dc:creator>ScottSusman</dc:creator>
      <dc:date>2016-10-18T12:48:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a dashboard token in an HTML panel?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-a-dashboard-token-in-an-HTML-panel/m-p/258207#M16229</link>
      <description>&lt;P&gt;Element &amp;lt;condition&amp;gt;  is child of one of Search Handler, such as&lt;BR /&gt;
&amp;lt;done | error | fail | cancelled | progress&amp;gt;&lt;BR /&gt;
Please move &amp;lt;condition&amp;gt; under &amp;lt;progress&amp;gt;  &lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2016 17:02:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-a-dashboard-token-in-an-HTML-panel/m-p/258207#M16229</guid>
      <dc:creator>afishkin_splunk</dc:creator>
      <dc:date>2016-10-18T17:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a dashboard token in an HTML panel?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-a-dashboard-token-in-an-HTML-panel/m-p/258208#M16230</link>
      <description>&lt;P&gt;That's pretty similar to somesoni2's suggestion to use  instead of &lt;/P&gt;

&lt;P&gt;Using &lt;CODE&gt;&amp;lt;progress&amp;gt;&amp;lt;condition&amp;gt;&lt;/CODE&gt; I now get &lt;CODE&gt;Host: $result.host$&lt;/CODE&gt;.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;         &amp;lt;search&amp;gt;
           &amp;lt;query&amp;gt;| metadata type=hosts | head 1&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;progress&amp;gt;
             &amp;lt;condition match="'job.isDone'"&amp;gt;
               &amp;lt;set token="MyHost"&amp;gt;$result.host$&amp;lt;/set&amp;gt;
             &amp;lt;/condition&amp;gt;
           &amp;lt;/progress&amp;gt;
         &amp;lt;/search&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Oct 2016 17:21:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-a-dashboard-token-in-an-HTML-panel/m-p/258208#M16230</guid>
      <dc:creator>ScottSusman</dc:creator>
      <dc:date>2016-10-18T17:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a dashboard token in an HTML panel?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-a-dashboard-token-in-an-HTML-panel/m-p/258209#M16231</link>
      <description>&lt;P&gt;try setting the job.isDone equal to 1, so that it has to be true to set the token?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;search&amp;gt;
    &amp;lt;query&amp;gt;...&amp;lt;/query&amp;gt;
    &amp;lt;done&amp;gt;
      &amp;lt;condition match="'job.isDone'"=1&amp;gt;
      &amp;lt;set token="host"&amp;gt;$result.host$&amp;lt;/set&amp;gt;
     &amp;lt;/condition&amp;gt;
    &amp;lt;/done&amp;gt;
  &amp;lt;/search&amp;gt;
&amp;lt;/panel&amp;gt;


&amp;lt;html&amp;gt;
      $host$
      &amp;lt;/html&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Oct 2016 18:51:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-a-dashboard-token-in-an-HTML-panel/m-p/258209#M16231</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2016-10-18T18:51:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a dashboard token in an HTML panel?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-a-dashboard-token-in-an-HTML-panel/m-p/258210#M16232</link>
      <description>&lt;P&gt;&lt;CODE&gt;&amp;lt;condition match="'job.isDone'"=1&amp;gt;&lt;/CODE&gt; was a syntax error, but when I changed it to &lt;CODE&gt;&amp;lt;condition match="'job.isDone'=1"&amp;gt;&lt;/CODE&gt; (with the =1 inside the quotes) it stayed as $MyHost$.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2016 19:04:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-a-dashboard-token-in-an-HTML-panel/m-p/258210#M16232</guid>
      <dc:creator>ScottSusman</dc:creator>
      <dc:date>2016-10-18T19:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a dashboard token in an HTML panel?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-a-dashboard-token-in-an-HTML-panel/m-p/258211#M16233</link>
      <description>&lt;P&gt;Not sure if it's relevant, but I can see the value switch from $MyHost$ to $result.host$.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2016 19:04:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-a-dashboard-token-in-an-HTML-panel/m-p/258211#M16233</guid>
      <dc:creator>ScottSusman</dc:creator>
      <dc:date>2016-10-18T19:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a dashboard token in an HTML panel?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-a-dashboard-token-in-an-HTML-panel/m-p/258212#M16234</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;| metadata type=hosts | head 1&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;preview&amp;gt;
       &amp;lt;set token="host"&amp;gt;$result.host$&amp;lt;/set&amp;gt;
     &amp;lt;/preview&amp;gt;
        &amp;lt;/search&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;html&amp;gt;
       $host|h$
       &amp;lt;/html&amp;gt;
  &amp;lt;/row&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Oct 2016 19:16:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-a-dashboard-token-in-an-HTML-panel/m-p/258212#M16234</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2016-10-18T19:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a dashboard token in an HTML panel?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-a-dashboard-token-in-an-HTML-panel/m-p/258213#M16235</link>
      <description>&lt;P&gt;It works!  You rock!&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2016 19:27:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-a-dashboard-token-in-an-HTML-panel/m-p/258213#M16235</guid>
      <dc:creator>ScottSusman</dc:creator>
      <dc:date>2016-10-18T19:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a dashboard token in an HTML panel?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-a-dashboard-token-in-an-HTML-panel/m-p/258214#M16236</link>
      <description>&lt;P&gt;It looks like between 6.4.0 and 6.5.0 there were some changes to the search options in the Simple XML.  Apparently it's important to be looking at docs for the correct version.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;done&amp;gt;  text        Execute actions based on finished search events.
&amp;lt;preview&amp;gt;   text        Preview of search results. Includes job properties and first result row.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thank you so much!&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2016 19:33:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-a-dashboard-token-in-an-HTML-panel/m-p/258214#M16236</guid>
      <dc:creator>ScottSusman</dc:creator>
      <dc:date>2016-10-18T19:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a dashboard token in an HTML panel?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-a-dashboard-token-in-an-HTML-panel/m-p/258215#M16237</link>
      <description>&lt;P&gt;Thanks, This is what exactly which I was searching for last 5 days..&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2017 15:01:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-a-dashboard-token-in-an-HTML-panel/m-p/258215#M16237</guid>
      <dc:creator>gvnd</dc:creator>
      <dc:date>2017-06-16T15:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a dashboard token in an HTML panel?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-a-dashboard-token-in-an-HTML-panel/m-p/628797#M51569</link>
      <description>&lt;P&gt;Even I had error and I had to drop the =1 for the error to go away.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2023 08:01:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-reference-a-dashboard-token-in-an-HTML-panel/m-p/628797#M51569</guid>
      <dc:creator>bullet</dc:creator>
      <dc:date>2023-01-30T08:01:04Z</dc:date>
    </item>
  </channel>
</rss>

