<?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: choose all Multiselect values by default without using * in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/choose-all-Multiselect-values-by-default-without-using/m-p/357861#M23298</link>
    <description>&lt;P&gt;@architkhanna, is your multiselect formed by static values or dynamic values? If it is dynamic is the list of fields/values limited or same?&lt;/P&gt;

&lt;P&gt;For static values you can use &lt;CODE&gt;&amp;lt;default&amp;gt;&lt;/CODE&gt; option to set the default values on load. Following is an example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="multiselect" token="tokMulti2"&amp;gt;
  &amp;lt;label&amp;gt;&amp;lt;/label&amp;gt;
  &amp;lt;choice value="value1"&amp;gt;Field 1&amp;lt;/choice&amp;gt;
  &amp;lt;choice value="value2"&amp;gt;Field 2&amp;lt;/choice&amp;gt;
  &amp;lt;choice value="value3"&amp;gt;Field 3&amp;lt;/choice&amp;gt;
  &amp;lt;default&amp;gt;value1,value2,value3&amp;lt;/default&amp;gt;
  &amp;lt;delimiter&amp;gt; &amp;lt;/delimiter&amp;gt;
&amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 09 Nov 2017 07:55:30 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2017-11-09T07:55:30Z</dc:date>
    <item>
      <title>choose all Multiselect values by default without using *</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/choose-all-Multiselect-values-by-default-without-using/m-p/357860#M23297</link>
      <description>&lt;P&gt;I have a multi-select who has its values populated by a lookup.If the lookup has 3 rows all three values show up.&lt;BR /&gt;
I want this multi-select to have all the values chosen by default WITHOUT USING ALL(*)&lt;BR /&gt;
All values should show up in the area of multi-select as chosen.&lt;BR /&gt;
If any leads kindly help&lt;BR /&gt;
or suggest some other input type can be used to fulfill this.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2017 06:56:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/choose-all-Multiselect-values-by-default-without-using/m-p/357860#M23297</guid>
      <dc:creator>architkhanna</dc:creator>
      <dc:date>2017-11-09T06:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: choose all Multiselect values by default without using *</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/choose-all-Multiselect-values-by-default-without-using/m-p/357861#M23298</link>
      <description>&lt;P&gt;@architkhanna, is your multiselect formed by static values or dynamic values? If it is dynamic is the list of fields/values limited or same?&lt;/P&gt;

&lt;P&gt;For static values you can use &lt;CODE&gt;&amp;lt;default&amp;gt;&lt;/CODE&gt; option to set the default values on load. Following is an example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="multiselect" token="tokMulti2"&amp;gt;
  &amp;lt;label&amp;gt;&amp;lt;/label&amp;gt;
  &amp;lt;choice value="value1"&amp;gt;Field 1&amp;lt;/choice&amp;gt;
  &amp;lt;choice value="value2"&amp;gt;Field 2&amp;lt;/choice&amp;gt;
  &amp;lt;choice value="value3"&amp;gt;Field 3&amp;lt;/choice&amp;gt;
  &amp;lt;default&amp;gt;value1,value2,value3&amp;lt;/default&amp;gt;
  &amp;lt;delimiter&amp;gt; &amp;lt;/delimiter&amp;gt;
&amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Nov 2017 07:55:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/choose-all-Multiselect-values-by-default-without-using/m-p/357861#M23298</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-11-09T07:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: choose all Multiselect values by default without using *</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/choose-all-Multiselect-values-by-default-without-using/m-p/357862#M23299</link>
      <description>&lt;P&gt;no this is not static value..as mentioned taken from the lookup.the lookup can be modified at any point of time&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2017 08:54:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/choose-all-Multiselect-values-by-default-without-using/m-p/357862#M23299</guid>
      <dc:creator>architkhanna</dc:creator>
      <dc:date>2017-11-09T08:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: choose all Multiselect values by default without using *</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/choose-all-Multiselect-values-by-default-without-using/m-p/357863#M23300</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;

&lt;P&gt;Can you please try this? I did it with the use javascript. I hope It will help to you.&lt;/P&gt;

&lt;P&gt;XML - Code&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form script="MultiDropdownView.js"&amp;gt;
  &amp;lt;label&amp;gt;Multi Select Default value MultiDropdownView&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="multiselect" token="tknSelectIndex" id="idSelectIndex"&amp;gt;
      &amp;lt;label&amp;gt;Select Index&amp;lt;/label&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;index&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;index&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;search id="idSearchSelectIndex"&amp;gt;
        &amp;lt;query&amp;gt;| eventcount summarize=false index=* index=_* | dedup index | fields index&amp;lt;/query&amp;gt;
        &amp;lt;earliest&amp;gt;-15m&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
      &amp;lt;/search&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;MultiDropdownView.js&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var deps = [
    "splunkjs/ready!"
];
require(deps, function(mvc) {

    var idSelectIndex = mvc.Components.get('idSelectIndex');
    var allValues = [];

    var idSearchSelectIndex = mvc.Components.get("idSearchSelectIndex");
    var idSearchSelectIndex_results = idSearchSelectIndex.data("preview");
    idSearchSelectIndex_results.on("data", function() {
         $.each(idSearchSelectIndex_results.data().rows, function( index, value ) {
            allValues.push(value[0]);
        });
        idSelectIndex.settings.set("default",allValues);
     });
});
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2017 09:06:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/choose-all-Multiselect-values-by-default-without-using/m-p/357863#M23300</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2017-11-09T09:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: choose all Multiselect values by default without using *</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/choose-all-Multiselect-values-by-default-without-using/m-p/357864#M23301</link>
      <description>&lt;P&gt;Figured this one out just yesterday:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="multiselect" token="tokMulti2"&amp;gt;
   &amp;lt;label&amp;gt;&amp;lt;/label&amp;gt;
   &amp;lt;choice value="value1"&amp;gt;Field 1&amp;lt;/choice&amp;gt;
   &amp;lt;choice value="value2"&amp;gt;Field 2&amp;lt;/choice&amp;gt;
   &amp;lt;choice value="value3"&amp;gt;Field 3&amp;lt;/choice&amp;gt;
   &amp;lt;default&amp;gt;"Field 1","Field 2","Field 3"&amp;lt;/default&amp;gt;
   &amp;lt;delimiter&amp;gt; &amp;lt;/delimiter&amp;gt;
 &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Yours would also work if you used initialValue instead of default.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;input type="multiselect" token="tokMulti3"&amp;gt;
   &amp;lt;label&amp;gt;&amp;lt;/label&amp;gt;
   &amp;lt;choice value="value1"&amp;gt;Field 1&amp;lt;/choice&amp;gt;
   &amp;lt;choice value="value2"&amp;gt;Field 2&amp;lt;/choice&amp;gt;
   &amp;lt;choice value="value3"&amp;gt;Field 3&amp;lt;/choice&amp;gt;
   &amp;lt;initialValue&amp;gt;value1,value2,value3&amp;lt;/initialValue&amp;gt;
   &amp;lt;delimiter&amp;gt; &amp;lt;/delimiter&amp;gt;
 &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Nov 2017 16:35:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/choose-all-Multiselect-values-by-default-without-using/m-p/357864#M23301</guid>
      <dc:creator>Kenshiro70</dc:creator>
      <dc:date>2017-11-11T16:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: choose all Multiselect values by default without using *</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/choose-all-Multiselect-values-by-default-without-using/m-p/357865#M23302</link>
      <description>&lt;P&gt;You can actually do this in your search by building the "All" value and then appending the set of individual values. You also have to make sure to use the "fieldforlabel" and "fieldforvalue" properties of the multi select.&lt;/P&gt;

&lt;P&gt;Your search will look something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup ServersList
| where Environment like "Development" AND ApplicationName like "MyApplication" 
| stats values(ServerName) as hostValues by _time 
| eval hostFilter="(host=\"".mvjoin(hostValues, "\" OR host=\"")."\")" 
| eval ServerLabel = "All" 
| rename hostFilter as ServerValue 
| append 
    [| inputlookup ProgServers 
    | where Environment like "Development" AND ApplicationName like "MyApplication" 
    | dedup ServerName 
    | sort +ServerName
    | rename ServerName as ServerLabel 
    | eval ServerValue = "host=\"".ServerLabel."\"" ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Notice the ServerLabel in the first search is "All", this is what will be displayed in the multi select to the user. The value is a set of OR statements that contain the same values as what is in the second search. Enjoy!!&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jan 2018 17:57:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/choose-all-Multiselect-values-by-default-without-using/m-p/357865#M23302</guid>
      <dc:creator>jjago1</dc:creator>
      <dc:date>2018-01-05T17:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: choose all Multiselect values by default without using *</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/choose-all-Multiselect-values-by-default-without-using/m-p/357866#M23303</link>
      <description>&lt;P&gt;that's great! Thank you for sharing.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Oct 2018 22:44:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/choose-all-Multiselect-values-by-default-without-using/m-p/357866#M23303</guid>
      <dc:creator>bnorthway_splun</dc:creator>
      <dc:date>2018-10-22T22:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: choose all Multiselect values by default without using *</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/choose-all-Multiselect-values-by-default-without-using/m-p/357867#M23304</link>
      <description>&lt;P&gt;Thanks, it helped for me. But one short question. What is reason for these two lines:    &lt;/P&gt;

&lt;P&gt;var defaultTokenModel = mvc.Components.get('default');&lt;BR /&gt;
var submittedTokens = mvc.Components.get('submitted');&lt;/P&gt;

&lt;P&gt;Cant see you are using the variabels. &lt;/P&gt;</description>
      <pubDate>Fri, 18 Jan 2019 15:19:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/choose-all-Multiselect-values-by-default-without-using/m-p/357867#M23304</guid>
      <dc:creator>stephanfuchs</dc:creator>
      <dc:date>2019-01-18T15:19:09Z</dc:date>
    </item>
    <item>
      <title>Re: choose all Multiselect values by default without using *</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/choose-all-Multiselect-values-by-default-without-using/m-p/357868#M23305</link>
      <description>&lt;P&gt;@stephanfuchs&lt;BR /&gt;
Good Catch.  Yes, these variable are unused.  I have updated my answer.&lt;/P&gt;

&lt;P&gt;Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Sat, 19 Jan 2019 12:13:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/choose-all-Multiselect-values-by-default-without-using/m-p/357868#M23305</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-01-19T12:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: choose all Multiselect values by default without using *</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/choose-all-Multiselect-values-by-default-without-using/m-p/538838#M36861</link>
      <description>&lt;P&gt;Thank you for the code&lt;/P&gt;&lt;P&gt;If it can help, I had to make a minor change to make it works properly in my case (some data were longer to load.) :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;var idSearchSelectIndex_results = idSearchSelectIndex.data("preview");&lt;/LI-CODE&gt;&lt;P&gt;By&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;var idSearchSelectIndex_results = idSearchSelectIndex.data("results");&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2021 22:02:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/choose-all-Multiselect-values-by-default-without-using/m-p/538838#M36861</guid>
      <dc:creator>ghonyme</dc:creator>
      <dc:date>2021-02-05T22:02:51Z</dc:date>
    </item>
  </channel>
</rss>

