<?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 do I know which token in a dashboard is not set? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-know-which-token-in-a-dashboard-is-not-set/m-p/346139#M22548</link>
    <description>&lt;P&gt;Absolutely. First open up the Javascript Console: &lt;A href="https://webmasters.stackexchange.com/a/77337"&gt;https://webmasters.stackexchange.com/a/77337&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Then paste in the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var missing_tokens = []

for(var attribute in splunkjs.mvc.Components.attributes){
    if(splunkjs.mvc.Components.attributes.hasOwnProperty(attribute) &amp;amp;&amp;amp; typeof splunkjs.mvc.Components.getInstance(attribute).lastError != "undefined" &amp;amp;&amp;amp; splunkjs.mvc.Components.getInstance(attribute).lastError == "Search is waiting for input..."){
        console.log("I have a manager..", attribute, splunkjs.mvc.Components.getInstance(attribute).lastError)
        var search=splunkjs.mvc.Components.attributes[attribute].attributes.search.replace(/\$\$\S+\$\$/g, "")
        var myRegex = /\$(\S*)\$/g,
            matches,
            tokens = [];
        while (matches = myRegex.exec(search)) {
           if(typeof splunkjs.mvc.Components.getInstance("submitted").get(matches[1]) == "undefined"){
                if(!(matches[1] in missing_tokens)){
                    missing_tokens[matches[1]] = 0
                }
                missing_tokens[matches[1]]++
           }
        }
    }
}
for(var token in missing_tokens){
    console.log("We found ", missing_tokens[token], " searches that are missing ", token, "-- add it via splunkjs.mvc.Components.getInstance(\"submitted\").set(\"" + token + "\", \"\")")
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The result will tell you how many searches are dependent on each token, and what you can manually do to set a token (for troubleshooting, or otherwise) also via the Javascript Console.&lt;/P&gt;</description>
    <pubDate>Tue, 25 Apr 2017 18:53:27 GMT</pubDate>
    <dc:creator>David</dc:creator>
    <dc:date>2017-04-25T18:53:27Z</dc:date>
    <item>
      <title>How do I know which token in a dashboard is not set?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-know-which-token-in-a-dashboard-is-not-set/m-p/346138#M22547</link>
      <description>&lt;P&gt;I have a complicated dashboard, with javascript, many panels, and all kinds of things. Some of my panels sometimes show "Search is waiting for input..." but I don't know how to figure out which token is not set. &lt;/P&gt;

&lt;P&gt;Is there something I can do in the javascript inspector that would help me figure out which token isn't being set? &lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 18:48:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-know-which-token-in-a-dashboard-is-not-set/m-p/346138#M22547</guid>
      <dc:creator>David</dc:creator>
      <dc:date>2017-04-25T18:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: How do I know which token in a dashboard is not set?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-know-which-token-in-a-dashboard-is-not-set/m-p/346139#M22548</link>
      <description>&lt;P&gt;Absolutely. First open up the Javascript Console: &lt;A href="https://webmasters.stackexchange.com/a/77337"&gt;https://webmasters.stackexchange.com/a/77337&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Then paste in the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var missing_tokens = []

for(var attribute in splunkjs.mvc.Components.attributes){
    if(splunkjs.mvc.Components.attributes.hasOwnProperty(attribute) &amp;amp;&amp;amp; typeof splunkjs.mvc.Components.getInstance(attribute).lastError != "undefined" &amp;amp;&amp;amp; splunkjs.mvc.Components.getInstance(attribute).lastError == "Search is waiting for input..."){
        console.log("I have a manager..", attribute, splunkjs.mvc.Components.getInstance(attribute).lastError)
        var search=splunkjs.mvc.Components.attributes[attribute].attributes.search.replace(/\$\$\S+\$\$/g, "")
        var myRegex = /\$(\S*)\$/g,
            matches,
            tokens = [];
        while (matches = myRegex.exec(search)) {
           if(typeof splunkjs.mvc.Components.getInstance("submitted").get(matches[1]) == "undefined"){
                if(!(matches[1] in missing_tokens)){
                    missing_tokens[matches[1]] = 0
                }
                missing_tokens[matches[1]]++
           }
        }
    }
}
for(var token in missing_tokens){
    console.log("We found ", missing_tokens[token], " searches that are missing ", token, "-- add it via splunkjs.mvc.Components.getInstance(\"submitted\").set(\"" + token + "\", \"\")")
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The result will tell you how many searches are dependent on each token, and what you can manually do to set a token (for troubleshooting, or otherwise) also via the Javascript Console.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 18:53:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-know-which-token-in-a-dashboard-is-not-set/m-p/346139#M22548</guid>
      <dc:creator>David</dc:creator>
      <dc:date>2017-04-25T18:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: How do I know which token in a dashboard is not set?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-know-which-token-in-a-dashboard-is-not-set/m-p/346140#M22549</link>
      <description>&lt;P&gt;Great detailed answer. I tend to simply throw relevant tokens into the title or subtitle bar of each panel while developing. Any tokens that aren't set should be obvious. &lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2017 18:06:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-know-which-token-in-a-dashboard-is-not-set/m-p/346140#M22549</guid>
      <dc:creator>chadmedeiros</dc:creator>
      <dc:date>2017-11-01T18:06:16Z</dc:date>
    </item>
  </channel>
</rss>

