<?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 input populate all users with a certain attribute. in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Multi-select-input-populate-all-users-with-a-certain-attribute/m-p/460550#M79503</link>
    <description>&lt;P&gt;If you are doing it right, you can use &lt;CODE&gt;*&lt;/CODE&gt;.  You should have a "suspicious users" lookup file like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="YouShouldAlwaysSpecifyAnIndex" AND sourcetype="AndSourcetypeToo" AND [|inputlookup suspicous_users_lookup.csv | table user]
| search $multiselect_token$
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 28 Mar 2020 19:47:27 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2020-03-28T19:47:27Z</dc:date>
    <item>
      <title>Multi-select input populate all users with a certain attribute.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Multi-select-input-populate-all-users-with-a-certain-attribute/m-p/460548#M79501</link>
      <description>&lt;P&gt;I have a Dashboard for viewing activity from suspicious accounts. I currently use a multi-select input where I am running a report to find suspicious accounts. I want to by default view activity for all of the suspicious accounts. I can't use the * for the "all" selection because it would show the activity for every user, not the subgroup of "suspicious users". Is there a way to have the dashboard auto-populate with data for all users that show up on the report? &lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 19:31:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Multi-select-input-populate-all-users-with-a-certain-attribute/m-p/460548#M79501</guid>
      <dc:creator>michael_valenzu</dc:creator>
      <dc:date>2020-03-27T19:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: Multi-select input populate all users with a certain attribute.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Multi-select-input-populate-all-users-with-a-certain-attribute/m-p/460549#M79502</link>
      <description>&lt;P&gt;@michael_valenzuela &lt;/P&gt;

&lt;P&gt;You can achieve this using javascript. Check below XML and code. Here you have to write additional search which provides the suspicious Accounts. Check id=suspiciousAccountsSearch in XML. Which will be used for setting up default value of  multi select.&lt;/P&gt;

&lt;P&gt;XML&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form script="status_dashboard.js"&amp;gt;
  &amp;lt;search id="suspiciousAccountsSearch"&amp;gt;
    &amp;lt;query&amp;gt;| makeresults count=5 | eval a=2 | accum a | eval user="user".a | table user&amp;lt;/query&amp;gt;
    &amp;lt;/search&amp;gt;
  &amp;lt;label&amp;gt;Default Multi Select&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="multiselect" token="AccountsDropdown" id="AccountsDropdown"&amp;gt;
      &amp;lt;label&amp;gt;field1&amp;lt;/label&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;user&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;user&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;| makeresults count=10 | eval a=1 | accum a | eval user="user".a&amp;lt;/query&amp;gt;
        &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
      &amp;lt;/search&amp;gt;
      &amp;lt;delimiter&amp;gt; &amp;lt;/delimiter&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;Javascript&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var deps = [
     "splunkjs/ready!"
 ];
 require(deps, function(mvc) {

     var idSelectIndex = mvc.Components.get('AccountsDropdown');
     var allValues = [];

     var idSearchSelectIndex = mvc.Components.get("suspiciousAccountsSearch");
     var idSearchSelectIndex_results = idSearchSelectIndex.data("preview");
     idSearchSelectIndex_results.on("data", function() {

          $.each(idSearchSelectIndex_results.data().rows, function( index, value ) {
            console.log(index, value)
             allValues.push(value[0]);

         });
         idSelectIndex.settings.set("default",allValues);
         // idSelectIndex.render();
      });
 });
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 28 Mar 2020 16:12:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Multi-select-input-populate-all-users-with-a-certain-attribute/m-p/460549#M79502</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2020-03-28T16:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: Multi-select input populate all users with a certain attribute.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Multi-select-input-populate-all-users-with-a-certain-attribute/m-p/460550#M79503</link>
      <description>&lt;P&gt;If you are doing it right, you can use &lt;CODE&gt;*&lt;/CODE&gt;.  You should have a "suspicious users" lookup file like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="YouShouldAlwaysSpecifyAnIndex" AND sourcetype="AndSourcetypeToo" AND [|inputlookup suspicous_users_lookup.csv | table user]
| search $multiselect_token$
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 28 Mar 2020 19:47:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Multi-select-input-populate-all-users-with-a-certain-attribute/m-p/460550#M79503</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2020-03-28T19:47:27Z</dc:date>
    </item>
  </channel>
</rss>

