<?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: Why doesn't Splunk acknowledge tokens set with JavaScript inside dashboard input tags? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-doesn-t-Splunk-acknowledge-tokens-set-with-JavaScript-inside/m-p/182354#M11215</link>
    <description>&lt;P&gt;Methinks you have a typo, try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var tokens  = mvc.Components.getInstance("submitted");
tokens.set(tabToken, '');
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;CODE&gt;submitted&lt;/CODE&gt; with 2 t's and 1 m.&lt;/P&gt;</description>
    <pubDate>Tue, 30 Jun 2015 19:02:46 GMT</pubDate>
    <dc:creator>alacercogitatus</dc:creator>
    <dc:date>2015-06-30T19:02:46Z</dc:date>
    <item>
      <title>Why doesn't Splunk acknowledge tokens set with JavaScript inside dashboard input tags?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-doesn-t-Splunk-acknowledge-tokens-set-with-JavaScript-inside/m-p/182353#M11214</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm having a problem using tokens set with JavaScript inside my XML, specifically inside input tags.&lt;/P&gt;

&lt;P&gt;I have a dashboard with tabs and I'm using js to set a token when I move between them.&lt;BR /&gt;
Then I use the token in my dashboard queries so they'll run only when their respective tab is active.&lt;/P&gt;

&lt;P&gt;All work's well for most queries, but for those inside an input tag, there's a problem: splunk doesn't acknowledge the token set within the js code. it does recognize tokens set within the xml.&lt;/P&gt;

&lt;P&gt;js code that sets the token:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var tokens  = mvc.Components.getInstance("submmited");
tokens.set(tabToken, '');
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;dashboard xml:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;!-- Doesn't work! --&amp;gt;
&amp;lt;input&amp;gt;
&amp;lt;search&amp;gt;
&amp;lt;query&amp;gt;
index=$index$ sourcetype=$sourcetype$ $control_token$
&amp;lt;/query&amp;gt;
&amp;lt;/search&amp;gt;
&amp;lt;/input&amp;gt;


&amp;lt;!-- Work! --&amp;gt;
&amp;lt;table&amp;gt;
&amp;lt;search&amp;gt;
&amp;lt;query&amp;gt;
index=$index$ sourcetype=$sourcetype$ $control_token$
&amp;lt;/query&amp;gt;
&amp;lt;/search&amp;gt;
&amp;lt;/table&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This behavior repeats throughout the dashboard, so I don't think it is caused by a faulty query. (also it starts working immediately after expelling the control_token)  &lt;/P&gt;

&lt;P&gt;Any ideas on why might this occur?&lt;BR /&gt;
thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2015 09:34:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-doesn-t-Splunk-acknowledge-tokens-set-with-JavaScript-inside/m-p/182353#M11214</guid>
      <dc:creator>pembleton</dc:creator>
      <dc:date>2015-06-30T09:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesn't Splunk acknowledge tokens set with JavaScript inside dashboard input tags?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-doesn-t-Splunk-acknowledge-tokens-set-with-JavaScript-inside/m-p/182354#M11215</link>
      <description>&lt;P&gt;Methinks you have a typo, try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var tokens  = mvc.Components.getInstance("submitted");
tokens.set(tabToken, '');
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;CODE&gt;submitted&lt;/CODE&gt; with 2 t's and 1 m.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2015 19:02:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-doesn-t-Splunk-acknowledge-tokens-set-with-JavaScript-inside/m-p/182354#M11215</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2015-06-30T19:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesn't Splunk acknowledge tokens set with JavaScript inside dashboard input tags?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-doesn-t-Splunk-acknowledge-tokens-set-with-JavaScript-inside/m-p/182355#M11216</link>
      <description>&lt;P&gt;the typo is only in my question, not in the source. sorry about that.&lt;BR /&gt;
anyway i don't think the problem is in a typo.&lt;BR /&gt;
like i said, the token does work on most queries just not inside an input tag.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2015 07:53:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-doesn-t-Splunk-acknowledge-tokens-set-with-JavaScript-inside/m-p/182355#M11216</guid>
      <dc:creator>pembleton</dc:creator>
      <dc:date>2015-07-01T07:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: Why doesn't Splunk acknowledge tokens set with JavaScript inside dashboard input tags?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-doesn-t-Splunk-acknowledge-tokens-set-with-JavaScript-inside/m-p/182356#M11217</link>
      <description>&lt;P&gt;hi @alacercogitatus, did you find any solution or alternate to his problem, bcs I am facing the same problem.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2017 13:40:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-doesn-t-Splunk-acknowledge-tokens-set-with-JavaScript-inside/m-p/182356#M11217</guid>
      <dc:creator>rvisj</dc:creator>
      <dc:date>2017-06-08T13:40:09Z</dc:date>
    </item>
  </channel>
</rss>

