<?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 Dashboard - multi-select input - how to add &amp;amp;quot;ANY&amp;amp;quot; option apart of the result of a query in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Dashboard-multi-select-input-how-to-add-amp-quot-ANY-amp-quot/m-p/524249#M147897</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am building a dashboard where I have an multi-select&amp;nbsp;input&amp;nbsp; called &lt;STRONG&gt;locations&lt;/STRONG&gt;, which is populated with a query via the dynamic options.&lt;/P&gt;&lt;P&gt;Also, I include a static option called "ANY" with a value *&lt;/P&gt;&lt;P&gt;I have also a token prefix and suffix of&amp;nbsp; double quotes (") and the delimiter of a coma ( , )&lt;/P&gt;&lt;P&gt;My purpose is later is in my query of one panel to use that token in a where IN clause&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;where location in ($locations$)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;when I dont select the ANY value, the query works as expected.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;where location in ("XXX", "YYY", "ZZZ")&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;but when I include the ANY in the multi-select input, the query does not seem to work.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;where location in ("XXX", "YYY", "ZZZ","*")&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Is it possible to do what I intend? is there any easier way to achieve the same?&lt;/P&gt;&lt;P&gt;Many thanks in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 12 Oct 2020 15:56:39 GMT</pubDate>
    <dc:creator>jacortijo</dc:creator>
    <dc:date>2020-10-12T15:56:39Z</dc:date>
    <item>
      <title>Dashboard - multi-select input - how to add &amp;quot;ANY&amp;quot; option apart of the result of a query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dashboard-multi-select-input-how-to-add-amp-quot-ANY-amp-quot/m-p/524249#M147897</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am building a dashboard where I have an multi-select&amp;nbsp;input&amp;nbsp; called &lt;STRONG&gt;locations&lt;/STRONG&gt;, which is populated with a query via the dynamic options.&lt;/P&gt;&lt;P&gt;Also, I include a static option called "ANY" with a value *&lt;/P&gt;&lt;P&gt;I have also a token prefix and suffix of&amp;nbsp; double quotes (") and the delimiter of a coma ( , )&lt;/P&gt;&lt;P&gt;My purpose is later is in my query of one panel to use that token in a where IN clause&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;where location in ($locations$)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;when I dont select the ANY value, the query works as expected.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;where location in ("XXX", "YYY", "ZZZ")&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;but when I include the ANY in the multi-select input, the query does not seem to work.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;where location in ("XXX", "YYY", "ZZZ","*")&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Is it possible to do what I intend? is there any easier way to achieve the same?&lt;/P&gt;&lt;P&gt;Many thanks in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2020 15:56:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dashboard-multi-select-input-how-to-add-amp-quot-ANY-amp-quot/m-p/524249#M147897</guid>
      <dc:creator>jacortijo</dc:creator>
      <dc:date>2020-10-12T15:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard - multi-select input - how to add &amp;quot;ANY&amp;quot; option apart of the result of a query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dashboard-multi-select-input-how-to-add-amp-quot-ANY-amp-quot/m-p/524264#M147902</link>
      <description>&lt;LI-CODE lang="markup"&gt;      &amp;lt;input type="multiselect" token="location"&amp;gt;
        &amp;lt;label&amp;gt;Select one or more location&amp;lt;/label&amp;gt;
        &amp;lt;choice value="All"&amp;gt;All&amp;lt;/choice&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=abc | dedup location | fields location&amp;lt;/query&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;fieldForLabel&amp;gt;location&amp;lt;/fieldForLabel&amp;gt;
        &amp;lt;fieldForValue&amp;gt;location&amp;lt;/fieldForValue&amp;gt;
        &amp;lt;prefix&amp;gt;(&amp;lt;/prefix&amp;gt;
        &amp;lt;valuePrefix&amp;gt;location ="&amp;lt;/valuePrefix&amp;gt;
        &amp;lt;valueSuffix&amp;gt;"&amp;lt;/valueSuffix&amp;gt;
        &amp;lt;delimiter&amp;gt; OR &amp;lt;/delimiter&amp;gt;
        &amp;lt;suffix&amp;gt;)&amp;lt;/suffix&amp;gt;
        &amp;lt;default&amp;gt;All&amp;lt;/default&amp;gt;
        &amp;lt;change&amp;gt;
          &amp;lt;eval token="form.location"&amp;gt;case(mvcount('form.location')=0,"All",mvcount('form.location')&amp;amp;gt;1 AND mvfind('form.location',"All")&amp;amp;gt;0,"All",mvcount('form.location')&amp;amp;gt;1 AND mvfind('form.location',"All")=0,mvfilter('form.location'!="All"),1==1,'form.location')&amp;lt;/eval&amp;gt;
          &amp;lt;eval token="location_choice"&amp;gt;if(mvfind('form.location',"All")=0,"location=*",$location$)&amp;lt;/eval&amp;gt;
        &amp;lt;/change&amp;gt;
      &amp;lt;/input&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;Your query would use $location_choice$ to filter your results&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2020 18:13:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dashboard-multi-select-input-how-to-add-amp-quot-ANY-amp-quot/m-p/524264#M147902</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-10-12T18:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard - multi-select input - how to add &amp;quot;ANY&amp;quot; option apart of the result of a query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dashboard-multi-select-input-how-to-add-amp-quot-ANY-amp-quot/m-p/524357#M147916</link>
      <description>&lt;P&gt;Thanks for the suggestion but I get an "undefined" error in Splunk while using your proposal.&lt;/P&gt;&lt;P&gt;I think that the error comes from the third option in the case clause.&lt;/P&gt;&lt;P&gt;&amp;lt;eval token="form.location"&amp;gt;&lt;/P&gt;&lt;P&gt;case(mvcount('form.location')==0,"ALL",&amp;nbsp; &amp;nbsp; &amp;nbsp;// Reasoning: If there is nothing selected... location = "ALL"&amp;nbsp;&lt;/P&gt;&lt;P&gt;mvcount('form.location')&amp;gt;1 AND mvfind('form.location',"ALL")&amp;gt;0,"ALL",&amp;nbsp; // Reasoning: if there are multiple selections including ALL.... location ="ALL"&lt;/P&gt;&lt;P&gt;Unfortunately I dont understand the meaning of the last case.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;mvcount('form.location')&amp;gt;1 AND mvfind('form.location',"ALL")==0, mvfilter('form.location'!="ALL"),1==1,'form.location')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I assume that the purpose is:&amp;nbsp; "if there are many selections and none is ALL, just leave it untouched. "&lt;/P&gt;&lt;P&gt;As it didnt work, I tried to replace it with some other code&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;mvcount('form.location')&amp;gt;1 AND mvfind('form.location',"ALL")==0,'form.location')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;but it didnt work at all. Actually ALL get locked in the input field, it is not possible to select anything else or even to remove the ALL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2020 09:53:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dashboard-multi-select-input-how-to-add-amp-quot-ANY-amp-quot/m-p/524357#M147916</guid>
      <dc:creator>jacortijo</dc:creator>
      <dc:date>2020-10-13T09:53:44Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard - multi-select input - how to add &amp;quot;ANY&amp;quot; option apart of the result of a query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dashboard-multi-select-input-how-to-add-amp-quot-ANY-amp-quot/m-p/524365#M147917</link>
      <description>&lt;P&gt;mvcount('form.location')=0,"All" - if nothing is selected, set to All&lt;/P&gt;&lt;P&gt;mvcount('form.location')&amp;amp;gt;1 AND mvfind('form.location',"All")&amp;amp;gt;0,"All" - if All has just been added, set to All&lt;/P&gt;&lt;P&gt;mvcount('form.location')&amp;amp;gt;1 AND mvfind('form.location',"All")=0,mvfilter('form.location'!="All") - if something has been added after All, remove All&lt;/P&gt;&lt;P&gt;1==1,'form.location' - otherwise , leave as is&lt;/P&gt;&lt;P&gt;Note that the case has to be all on one line otherwise you get an error&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2020 10:12:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dashboard-multi-select-input-how-to-add-amp-quot-ANY-amp-quot/m-p/524365#M147917</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-10-13T10:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard - multi-select input - how to add &amp;quot;ANY&amp;quot; option apart of the result of a query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dashboard-multi-select-input-how-to-add-amp-quot-ANY-amp-quot/m-p/524388#M147922</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I tried once again and it does not work. every time I click in any value of the drop down box, the element seems to be added and removed from the input.&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;input type="multiselect" token="location"&amp;gt;
      &amp;lt;label&amp;gt;Select location&amp;lt;/label&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;location&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;location&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;index=xxx | dedup location | table location | sort + location&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;valuePrefix&amp;gt;location="&amp;lt;/valuePrefix&amp;gt;
      &amp;lt;valueSuffix&amp;gt;"&amp;lt;/valueSuffix&amp;gt;
      &amp;lt;delimiter&amp;gt; OR &amp;lt;/delimiter&amp;gt;
      &amp;lt;choice value="All"&amp;gt;All&amp;lt;/choice&amp;gt;
      &amp;lt;prefix&amp;gt;(&amp;lt;/prefix&amp;gt;
      &amp;lt;suffix&amp;gt;)&amp;lt;/suffix&amp;gt;
      &amp;lt;change&amp;gt;
        &amp;lt;eval token="form.location"&amp;gt;case(mvcount('form.location')=0,"All",mvcount('form.location')&amp;amp;gt;1 AND mvfind('form.location',"All")&amp;amp;gt;0,"All",mvcount('form.location')&amp;amp;gt;1 AND mvfind('form.location',"All")=0,mvfilter('form.location'!="All"),1==1,'form.location')&amp;lt;/eval&amp;gt;
        &amp;lt;eval token="location_choice"&amp;gt;if(mvfind('form.location',"All")=0,"location=*",$location$)&amp;lt;/eval&amp;gt;
      &amp;lt;/change&amp;gt;
    &amp;lt;/input&amp;gt;&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 13 Oct 2020 11:33:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dashboard-multi-select-input-how-to-add-amp-quot-ANY-amp-quot/m-p/524388#M147922</guid>
      <dc:creator>jacortijo</dc:creator>
      <dc:date>2020-10-13T11:33:58Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard - multi-select input - how to add &amp;quot;ANY&amp;quot; option apart of the result of a query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dashboard-multi-select-input-how-to-add-amp-quot-ANY-amp-quot/m-p/524389#M147923</link>
      <description>&lt;P&gt;Try moving the&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;choice value="All"&amp;gt;All&amp;lt;/choice&amp;gt;&lt;/PRE&gt;&lt;P&gt;so it is above the search&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;index=xxx | dedup location | table location | sort + location&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;&lt;/PRE&gt;&lt;P&gt;That way, if it is there, it will be at index 0 which the case statement relies on&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2020 11:46:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dashboard-multi-select-input-how-to-add-amp-quot-ANY-amp-quot/m-p/524389#M147923</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-10-13T11:46:44Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard - multi-select input - how to add &amp;quot;ANY&amp;quot; option apart of the result of a query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dashboard-multi-select-input-how-to-add-amp-quot-ANY-amp-quot/m-p/524396#M147925</link>
      <description>&lt;P&gt;The issue remains. I tried to simplify it with no luck either.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;change&amp;gt;
&amp;lt;eval token="location_choice"&amp;gt;if(mvfind('form.location',"All")&amp;gt;=0,"location=*",$location$)&amp;lt;/eval&amp;gt;
&amp;lt;/change&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;Reasoning: if All is part of the selection , location_choice is set to "location=*" otherwise $location$.&lt;/P&gt;&lt;P&gt;Unfortunately I get a really weird behaviour. It seems like the value of location_choice remains even after I removed the items in the input field. So the dashboard searches are using the old location_choice , very inconsistent behaviour.&lt;/P&gt;&lt;P&gt;could you confirm how does the input actually work? I select a value, the value get appended to the field and fires the change event . Then the eval tag just replace the field value with the result of the case clauses, right? In which moment all prefixes and suffixes are appended? only when the $location$ gets extracted in the second eval?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2020 12:15:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dashboard-multi-select-input-how-to-add-amp-quot-ANY-amp-quot/m-p/524396#M147925</guid>
      <dc:creator>jacortijo</dc:creator>
      <dc:date>2020-10-13T12:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard - multi-select input - how to add &amp;quot;ANY&amp;quot; option apart of the result of a query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dashboard-multi-select-input-how-to-add-amp-quot-ANY-amp-quot/m-p/524399#M147926</link>
      <description>&lt;P&gt;I finally solved it, far from perfect but it seems to work.&lt;/P&gt;&lt;P&gt;I basically remove all the change events and put a * as value for All.&lt;/P&gt;&lt;P&gt;It generated a not optimal query but it works at least.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  &amp;lt;input type="multiselect" token="location" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Select location&amp;lt;/label&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;location&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;location&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;choice value="*"&amp;gt;All&amp;lt;/choice&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;index=xxx | dedup location | table location | sort + location&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;valuePrefix&amp;gt;location="&amp;lt;/valuePrefix&amp;gt;
      &amp;lt;valueSuffix&amp;gt;"&amp;lt;/valueSuffix&amp;gt;
      &amp;lt;delimiter&amp;gt; OR &amp;lt;/delimiter&amp;gt;
      &amp;lt;prefix&amp;gt;(&amp;lt;/prefix&amp;gt;
      &amp;lt;suffix&amp;gt;)&amp;lt;/suffix&amp;gt;
    &amp;lt;/input&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Thanks for the support anyway!&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2020 12:45:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dashboard-multi-select-input-how-to-add-amp-quot-ANY-amp-quot/m-p/524399#M147926</guid>
      <dc:creator>jacortijo</dc:creator>
      <dc:date>2020-10-13T12:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard - multi-select input - how to add &amp;quot;ANY&amp;quot; option apart of the result of a query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dashboard-multi-select-input-how-to-add-amp-quot-ANY-amp-quot/m-p/524403#M147927</link>
      <description>&lt;P&gt;The first eval with the case statement operates on the multivalue field associated with the multiselect dropdown and basically deals with whether All is selected or needs to be removed.&lt;/P&gt;&lt;P&gt;The second eval uses the token value built up by using the prefix, value prefix, value, value suffix, and suffix, and assigns the choice token to this string unless All is selected in which case it uses the * option.&lt;/P&gt;&lt;P&gt;The prefixes and suffixes etc. are always there, but just in the named token, not in the multi-value field associated with the multi-select dropdown.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2020 13:05:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dashboard-multi-select-input-how-to-add-amp-quot-ANY-amp-quot/m-p/524403#M147927</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-10-13T13:05:44Z</dc:date>
    </item>
  </channel>
</rss>

