<?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: How do I make a dropdown dynamic based on a feed/search. in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-make-a-dropdown-dynamic-based-on-a-feed-search/m-p/126544#M7462</link>
    <description>&lt;P&gt;Here you go&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="dropdown" token="subrack_No"&amp;gt;
 &amp;lt;label&amp;gt;subrack_No:&amp;lt;/label&amp;gt;
      &amp;lt;choice value="*"&amp;gt;All&amp;lt;/choice&amp;gt;
      &amp;lt;populatingSearch fieldForLabel="subrack_No" fieldForValue="subrack_No"&amp;gt; index=core ..... | stats count by subrack_No &amp;lt;/populatingSearch&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or this, only with splunk 6.2 and more&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;      &amp;lt;input type="dropdown" token="subrack_No"&amp;gt;
  &amp;lt;label&amp;gt;subrack_No:&amp;lt;/label&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=core ..... | stats count by subrack_No&amp;lt;/query&amp;gt;
          &amp;lt;/search&amp;gt;
          &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
          &amp;lt;fieldForLabel&amp;gt;subrack_No&amp;lt;/fieldForLabel&amp;gt;
          &amp;lt;fieldForValue&amp;gt;subrack_No&amp;lt;/fieldForValue&amp;gt;
        &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 24 May 2015 23:49:27 GMT</pubDate>
    <dc:creator>stephanefotso</dc:creator>
    <dc:date>2015-05-24T23:49:27Z</dc:date>
    <item>
      <title>How do I make a dropdown dynamic based on a feed/search.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-make-a-dropdown-dynamic-based-on-a-feed-search/m-p/126543#M7461</link>
      <description>&lt;P&gt;How do I write this so that it is dynamic based on the search that is done. That is the search will populate my choices based on the data that is available. So if threre is only subrack 0,1 and 2 then the dropdown would have All, 0, 1, 2.  But then if threre is only subrack 0, and 1 then the dropdown would have All, 0, 1. This would make the dropdown more dynamic controlled by the search.  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;input type="dropdown" token="subrack_No"&amp;gt;
    &amp;lt;label&amp;gt;subrack_No:&amp;lt;/label&amp;gt;
    &amp;lt;choice value="*"&amp;gt;All&amp;lt;/choice&amp;gt;
    &amp;lt;choice value="0"&amp;gt;0&amp;lt;/choice&amp;gt;
    &amp;lt;choice value="1"&amp;gt;1&amp;lt;/choice&amp;gt;
    &amp;lt;choice value="2"&amp;gt;2&amp;lt;/choice&amp;gt;
    &amp;lt;choice value="3"&amp;gt;3&amp;lt;/choice&amp;gt;
    &amp;lt;choice value="4"&amp;gt;4&amp;lt;/choice&amp;gt;
    &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
  &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;example of a search :&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=core ..... | stats values(subrack_No)&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 24 May 2015 23:03:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-make-a-dropdown-dynamic-based-on-a-feed-search/m-p/126543#M7461</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2015-05-24T23:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do I make a dropdown dynamic based on a feed/search.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-make-a-dropdown-dynamic-based-on-a-feed-search/m-p/126544#M7462</link>
      <description>&lt;P&gt;Here you go&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="dropdown" token="subrack_No"&amp;gt;
 &amp;lt;label&amp;gt;subrack_No:&amp;lt;/label&amp;gt;
      &amp;lt;choice value="*"&amp;gt;All&amp;lt;/choice&amp;gt;
      &amp;lt;populatingSearch fieldForLabel="subrack_No" fieldForValue="subrack_No"&amp;gt; index=core ..... | stats count by subrack_No &amp;lt;/populatingSearch&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or this, only with splunk 6.2 and more&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;      &amp;lt;input type="dropdown" token="subrack_No"&amp;gt;
  &amp;lt;label&amp;gt;subrack_No:&amp;lt;/label&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=core ..... | stats count by subrack_No&amp;lt;/query&amp;gt;
          &amp;lt;/search&amp;gt;
          &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
          &amp;lt;fieldForLabel&amp;gt;subrack_No&amp;lt;/fieldForLabel&amp;gt;
          &amp;lt;fieldForValue&amp;gt;subrack_No&amp;lt;/fieldForValue&amp;gt;
        &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 24 May 2015 23:49:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-make-a-dropdown-dynamic-based-on-a-feed-search/m-p/126544#M7462</guid>
      <dc:creator>stephanefotso</dc:creator>
      <dc:date>2015-05-24T23:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: How do I make a dropdown dynamic based on a feed/search.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-make-a-dropdown-dynamic-based-on-a-feed-search/m-p/126545#M7463</link>
      <description>&lt;P&gt;&lt;CODE&gt;index=core ...|  stats count by subrackNo&lt;/CODE&gt; this search gives me a 2 column result, subrackNo and count.&lt;/P&gt;

&lt;P&gt;so when I put this search in the dropdown when the dashboard loads, the dropdown does not fill, under the dropdown it says &lt;/P&gt;

&lt;P&gt;&amp;gt; Duplicate labels causing conflict&lt;/P&gt;

&lt;P&gt;For clarification as I may not have been clear: the field that has the values I want to fill the dropdown is called &lt;CODE&gt;subrackNo&lt;/CODE&gt; and not &lt;CODE&gt;subrack_No&lt;/CODE&gt;, if that makes a difference. this is why my search in the dropdown should look like &lt;CODE&gt;index=core ...|  stats count by subrackNo&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I also tried using &lt;BR /&gt;
&lt;CODE&gt;index=core ...|  stats values(subrackNo)&lt;/CODE&gt; to fill the dropdown but it does not fill it. &lt;/P&gt;</description>
      <pubDate>Mon, 25 May 2015 20:46:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-make-a-dropdown-dynamic-based-on-a-feed-search/m-p/126545#M7463</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2015-05-25T20:46:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do I make a dropdown dynamic based on a feed/search.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-make-a-dropdown-dynamic-based-on-a-feed-search/m-p/126546#M7464</link>
      <description>&lt;P&gt;Ok! Means also your field for Label and Field for Value must be modified! Here you go&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;amp;lt;input type="dropdown" token="subrack_No"&amp;amp;gt;
   &amp;amp;lt;label&amp;amp;gt;subrack_No:&amp;amp;lt;/label&amp;amp;gt;
           &amp;amp;lt;choice value="*"&amp;amp;gt;All&amp;amp;lt;/choice&amp;amp;gt;
           &amp;amp;lt;search&amp;amp;gt;
             &amp;amp;lt;query&amp;amp;gt; index=core ..... | stats count by subrackNo&amp;amp;lt;/query&amp;amp;gt;
           &amp;amp;lt;/search&amp;amp;gt;
           &amp;amp;lt;default&amp;amp;gt;*&amp;amp;lt;/default&amp;amp;gt;
           &amp;amp;lt;fieldForLabel&amp;amp;gt;subrackNo&amp;amp;lt;/fieldForLabel&amp;amp;gt;
           &amp;amp;lt;fieldForValue&amp;amp;gt;subrackNo&amp;amp;lt;/fieldForValue&amp;amp;gt;
         &amp;amp;lt;/input&amp;amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 May 2015 21:07:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-make-a-dropdown-dynamic-based-on-a-feed-search/m-p/126546#M7464</guid>
      <dc:creator>stephanefotso</dc:creator>
      <dc:date>2015-05-25T21:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I make a dropdown dynamic based on a feed/search.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-make-a-dropdown-dynamic-based-on-a-feed-search/m-p/126547#M7465</link>
      <description>&lt;P&gt;ah thanks the field name goes in here &lt;/P&gt;

&lt;P&gt;&amp;lt;fieldForLabel&amp;gt;subrackNo&amp;lt;/fieldForLabel&amp;gt;&lt;BR /&gt;
&amp;lt;fieldForValue&amp;gt;subrackNo&amp;lt;/fieldForValue&amp;gt;&lt;/P&gt;

&lt;P&gt;I thought it should be the token name.&lt;/P&gt;</description>
      <pubDate>Mon, 25 May 2015 23:52:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-make-a-dropdown-dynamic-based-on-a-feed-search/m-p/126547#M7465</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2015-05-25T23:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do I make a dropdown dynamic based on a feed/search.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-make-a-dropdown-dynamic-based-on-a-feed-search/m-p/126548#M7466</link>
      <description>&lt;P&gt;Interesting how this gives only 1 value in the dropdown of somwthing like, &lt;CODE&gt;0,1,2,3&lt;/CODE&gt; &lt;BR /&gt;
&lt;CODE&gt;index=core ... | stats values(subrackNo) as subrackNo&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2015 00:07:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-make-a-dropdown-dynamic-based-on-a-feed-search/m-p/126548#M7466</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2015-05-26T00:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do I make a dropdown dynamic based on a feed/search.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-make-a-dropdown-dynamic-based-on-a-feed-search/m-p/126549#M7467</link>
      <description>&lt;P&gt;you have several ways to do it, depend on you&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=core ... | stats values(subrackNo) as subrackNo|head 1

index=core ... | stats first(subrackNo) as subrackNo

index=core ... | stats values(subrackNo) as subrackNo|where subrakNo=1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;etc...&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2015 22:12:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-make-a-dropdown-dynamic-based-on-a-feed-search/m-p/126549#M7467</guid>
      <dc:creator>stephanefotso</dc:creator>
      <dc:date>2015-05-26T22:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: How do I make a dropdown dynamic based on a feed/search.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-make-a-dropdown-dynamic-based-on-a-feed-search/m-p/126550#M7468</link>
      <description>&lt;P&gt;I did something very similar to this but my concept was based on 2 dropdowns. The first one does a &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputcsv foo.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and then the user selects the value where the fieldlabel/fieldvalue gets assigned to the token $test&lt;/P&gt;

&lt;P&gt;the next dropdown does &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputcsv foo2.csv | search tag="$test$"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;which then filters down foo2.csv to only show the tags related to the value selected in the dropdown. The selection sets the token $Choice. This works fine.&lt;/P&gt;

&lt;P&gt;I wasn't able to make a third dropdown work.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2017 21:19:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-make-a-dropdown-dynamic-based-on-a-feed-search/m-p/126550#M7468</guid>
      <dc:creator>_jgpm_</dc:creator>
      <dc:date>2017-02-17T21:19:57Z</dc:date>
    </item>
  </channel>
</rss>

