<?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: multi select box in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/multi-select-box/m-p/156889#M9662</link>
    <description>&lt;P&gt;I'm running into this too. I think that " | dbquery " is non-functional in this search. As soon as I change it back to a search on indexed data, it works.&lt;/P&gt;</description>
    <pubDate>Thu, 06 Mar 2014 16:23:48 GMT</pubDate>
    <dc:creator>tfitzgerald_col</dc:creator>
    <dc:date>2014-03-06T16:23:48Z</dc:date>
    <item>
      <title>multi select box</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/multi-select-box/m-p/156888#M9661</link>
      <description>&lt;P&gt;Hi Guys,&lt;BR /&gt;
I hope someone can help me .To prepare multiselect box I took help from Splunk 6 dashboard example and I used 2 script files on the basis of that data is appearing in the multiselect box but the problem is with table which is based on that selection for single value it works fine but when I select more than one value it says no record found.&lt;BR /&gt;
What I have observed that the problem is with the join which has been mentioned in the javascript file (multi_value_token19.js) here is the overall code (xml code, test21.js , multi_value_token19.js)&lt;/P&gt;

&lt;P&gt;**************&lt;STRONG&gt;&lt;EM&gt;XML code&lt;/EM&gt;&lt;/STRONG&gt;********************&lt;BR /&gt;
&lt;DASHBOARD script="test21.js , multi_value_token18.js"&gt;&lt;BR /&gt;
    &lt;LABEL&gt;Multi Select&lt;/LABEL&gt;&lt;BR /&gt;
    &amp;lt;!-- Leverage row grouping to put the input in the panel --&amp;gt;&lt;BR /&gt;
    &lt;ROW&gt;&lt;BR /&gt;
        &amp;lt;!-- Use an html panel to have a place for multi_select.js to put the multi select --&amp;gt;&lt;BR /&gt;
        &lt;BR /&gt;
            &lt;LABEL&gt;period_name&lt;/LABEL&gt;&lt;BR /&gt;
            &lt;/ROW&gt;&lt;/DASHBOARD&gt;&lt;/P&gt;&lt;DIV id="multi_value_input"&gt;&lt;BR /&gt;
         &lt;BR /&gt;
  &lt;TABLE&gt;&lt;BR /&gt;
      &lt;TITLE&gt;Multi Value Search&lt;/TITLE&gt;&lt;BR /&gt;
      &lt;SEARCHSTRING&gt;| dbquery "Finance Database" "select  * from fa_deprn_periods where period_name like '$multiTokenQuery$' " &lt;BR /&gt;
      &lt;/SEARCHSTRING&gt;&lt;BR /&gt;
    &lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;
  &lt;BR /&gt;
&lt;P&gt;&lt;/P&gt;

&lt;P&gt;******************&lt;STRONG&gt;&lt;EM&gt;test21.js&lt;/EM&gt;&lt;/STRONG&gt;**********************&lt;/P&gt;

&lt;P&gt;require(['jquery',&lt;BR /&gt;
    'underscore',&lt;BR /&gt;
    'splunkjs/mvc',&lt;BR /&gt;
    'splunkjs/mvc/multiselectview',&lt;BR /&gt;
    'splunkjs/mvc/searchmanager',&lt;BR /&gt;
    'splunkjs/mvc/simplexml/ready!'], &lt;BR /&gt;
    function($, _, mvc, MultiSelectView,SearchManager){&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    //Instantiate our multi select view
    multiSelect = new MultiSelectView({
        "id": "multi_value_input",
        "value": "$submitted:multiToken$",
        "el": $('#multi_value_input'),
        "labelField": "period_name",
        "valueField": "period_name",
        "managerid": "multiSearch"
    }, {tokens: true}).render();

    //Run the search the multi select is looking for
    var multiSearch = new SearchManager({
        "id": "multiSearch",
        "earliest_time": "-15m",
        "status_buckets": 0,
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;"search": '| dbquery "Finance Database" "select period_name "period_name" from fa_deprn_periods"',&lt;BR /&gt;
            "cancelOnUnload": true,&lt;BR /&gt;
            "latest_time": "now",&lt;BR /&gt;
            "auto_cancel": 90,&lt;BR /&gt;
            "preview": true&lt;BR /&gt;
        }, {tokens: true});&lt;BR /&gt;
    }&lt;BR /&gt;
);&lt;/P&gt;

&lt;P&gt;***************&lt;STRONG&gt;&lt;EM&gt;multi_value_token19.js&lt;/EM&gt;&lt;/STRONG&gt;***************&lt;/P&gt;

&lt;P&gt;require(['jquery','underscore','splunkjs/mvc','splunkjs/mvc/simplexml/ready!'], function($, _, mvc, SimpleSplunkView){&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;//Grab the instance of the token model for submitted tokens
var submitted = mvc.Components.get('submitted');

//When the token bound to the multi value input changes recompute the query
submitted.on('change:multiToken',function(submitted, value) {
    setMultiTokenQuery(value);
},this);


var setMultiTokenQuery = function(value){
    //Handle the default cases, if we aren't passed a value, search everything
    value = value || [];
    if (value.length === 0) {
        value.unshift("%");
    }
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;alert(value);&lt;BR /&gt;
        //Produce the search query and set the token&lt;BR /&gt;
        var multiTokenQuery = value.join('OR period_name=');&lt;BR /&gt;
        submitted.set('multiTokenQuery', multiTokenQuery);&lt;BR /&gt;
    };&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;//Set the initial value for the query.
setMultiTokenQuery(submitted.get('multiToken'));
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;});&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:55:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/multi-select-box/m-p/156888#M9661</guid>
      <dc:creator>vikas_gopal</dc:creator>
      <dc:date>2020-09-28T15:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: multi select box</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/multi-select-box/m-p/156889#M9662</link>
      <description>&lt;P&gt;I'm running into this too. I think that " | dbquery " is non-functional in this search. As soon as I change it back to a search on indexed data, it works.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Mar 2014 16:23:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/multi-select-box/m-p/156889#M9662</guid>
      <dc:creator>tfitzgerald_col</dc:creator>
      <dc:date>2014-03-06T16:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: multi select box</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/multi-select-box/m-p/156890#M9663</link>
      <description>&lt;P&gt;@tfitzgerald_column &lt;BR /&gt;
My mistake I should have answer this question as I resolved this issue .DBquery works absolutely fine actually problem was with the dashboard query which shows data in the table .Check the below link for the solution&lt;BR /&gt;
&lt;A href="http://answers.splunk.com/answers/123811/table-shows-no-record-if-multiple-values-selected-in-the-multiselect-box"&gt;http://answers.splunk.com/answers/123811/table-shows-no-record-if-multiple-values-selected-in-the-multiselect-box&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Mar 2014 18:17:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/multi-select-box/m-p/156890#M9663</guid>
      <dc:creator>vikas_gopal</dc:creator>
      <dc:date>2014-03-06T18:17:34Z</dc:date>
    </item>
  </channel>
</rss>

