<?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: Alternative to using token in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Alternative-to-using-token/m-p/346690#M22604</link>
    <description>&lt;P&gt;Yes. Thank you!&lt;/P&gt;</description>
    <pubDate>Fri, 22 Dec 2017 17:38:05 GMT</pubDate>
    <dc:creator>tamduong16</dc:creator>
    <dc:date>2017-12-22T17:38:05Z</dc:date>
    <item>
      <title>Alternative to using token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Alternative-to-using-token/m-p/346686#M22600</link>
      <description>&lt;P&gt;I have a very complicated dashboard which contains probably more than 20 tokens if I decide to do it this way. I want splunk to run search base on user dropdown value. For example: I have panel 1 which run query abc and panel 2 which run query bcd, panel3, etc. And all of this are different search base on token1. I tried to use (panel depends=token) for 3 panels but it already complicated and slow with 3 panels. I can't imagine having 20 like this. Is there an alternative to using token, like if else, or javascript?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2017 16:06:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Alternative-to-using-token/m-p/346686#M22600</guid>
      <dc:creator>tamduong16</dc:creator>
      <dc:date>2017-12-15T16:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative to using token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Alternative-to-using-token/m-p/346687#M22601</link>
      <description>&lt;P&gt;So basically you want 3 or more different searches to run , based on a token that comes from a dropdown ?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2017 22:38:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Alternative-to-using-token/m-p/346687#M22601</guid>
      <dc:creator>greggz</dc:creator>
      <dc:date>2017-12-19T22:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative to using token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Alternative-to-using-token/m-p/346688#M22602</link>
      <description>&lt;P&gt;So assuming I got your problem right, this should do the trick. If you have more specifications plz tell me, I assumed some things since you didn't specified everything.&lt;/P&gt;

&lt;P&gt;EDIT: Based on a token from a dropdown, all searches will respond to that value.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;require([
    'underscore',
    'splunkjs/mvc/searchmanager',
    'splunkjs/mvc',
    'splunkjs/mvc/simplexml/ready!'
], function (_, SearchManager, mvc) {

         var tokens = mvc.Components.get("default");

         mvc.Components.get("my-dropdown-id").on("change", function(this){

        // Manually start the searches when the value of the dropdown changes. 
        firstSearch.startSearch();
        secondSearch.startSearch();
        /* 
        .
        .
        .
        */
    });

    // Create all the searches you want

    var firstSearch = new SearchManager({
            id: "example-search-1",
            earliest_time: "-24h@h",
            latest_time: "now",
            preview: true,
            cache: false,
            autostart: false,
            search: "index=_internal host=$DropDownToken$| stats count by sourcetype" }, {tokens: true});


    var secondSearch = new SearchManager({
            id: "example-search-2",
            earliest_time: "-24h@h",
            latest_time: "now",
            preview: true,
            cache: false,
            autostart: false,
            search: "index=_internal  host=$DropDownToken$| stats count by source" },{tokens:true});

    // Assuming in your panels you have tables you must associate the views to the searches manually

    mvc.Components.get("myTable1").options.managerid = firstSearch;
    mvc.Components.get("myTable2").options.managerid = secondSearch;
}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Dec 2017 23:06:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Alternative-to-using-token/m-p/346688#M22602</guid>
      <dc:creator>greggz</dc:creator>
      <dc:date>2017-12-19T23:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative to using token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Alternative-to-using-token/m-p/346689#M22603</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
can you try using basesearch for you dashboard in xml? This will help your dashboard run faster as the panels will depend only on one search.&lt;BR /&gt;
You can check below link for Base Search.&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/502016/base-search-query-for-different-dashboard-panels.html"&gt;https://answers.splunk.com/answers/502016/base-search-query-for-different-dashboard-panels.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2017 07:08:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Alternative-to-using-token/m-p/346689#M22603</guid>
      <dc:creator>nikita_p</dc:creator>
      <dc:date>2017-12-20T07:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative to using token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Alternative-to-using-token/m-p/346690#M22604</link>
      <description>&lt;P&gt;Yes. Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 22 Dec 2017 17:38:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Alternative-to-using-token/m-p/346690#M22604</guid>
      <dc:creator>tamduong16</dc:creator>
      <dc:date>2017-12-22T17:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative to using token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Alternative-to-using-token/m-p/346691#M22605</link>
      <description>&lt;P&gt;If you have tokens that you want to include in the searches tell me and I will update the answer accordingly&lt;/P&gt;</description>
      <pubDate>Fri, 22 Dec 2017 17:44:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Alternative-to-using-token/m-p/346691#M22605</guid>
      <dc:creator>greggz</dc:creator>
      <dc:date>2017-12-22T17:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative to using token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Alternative-to-using-token/m-p/346692#M22606</link>
      <description>&lt;P&gt;@greggz. Thanks for answering my question. Do you know where I could add this code in Splunk? Which file would it be? I'm new to javascript in Splunk so please excuse my ignorance. &lt;/P&gt;</description>
      <pubDate>Fri, 22 Dec 2017 18:48:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Alternative-to-using-token/m-p/346692#M22606</guid>
      <dc:creator>tamduong16</dc:creator>
      <dc:date>2017-12-22T18:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative to using token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Alternative-to-using-token/m-p/346693#M22607</link>
      <description>&lt;P&gt;@tamduong16 Attention that this might not still be right, I need more specifications of your code to make it fully functional.&lt;/P&gt;

&lt;P&gt;You save this in under the directory:&lt;/P&gt;

&lt;P&gt;etc/apps/yourApp/appserver/static/myJsFile.js&lt;/P&gt;

&lt;P&gt;In Simple XML you do &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form script="myJsFile.js"&amp;gt;
..
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Dec 2017 19:38:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Alternative-to-using-token/m-p/346693#M22607</guid>
      <dc:creator>greggz</dc:creator>
      <dc:date>2017-12-22T19:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative to using token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Alternative-to-using-token/m-p/346694#M22608</link>
      <description>&lt;P&gt;@tamduong16, please go through this under 5 minutes of Splunk How To video on &lt;A href="https://www.youtube.com/watch?v=lojUc9v37Jg"&gt;Using Javascript in Splunk Dashboards&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Dec 2017 21:38:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Alternative-to-using-token/m-p/346694#M22608</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-12-22T21:38:38Z</dc:date>
    </item>
  </channel>
</rss>

