<?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 to populate dropdown input with ids from search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-populate-dropdown-input-with-ids-from-search/m-p/147299#M41173</link>
    <description>&lt;P&gt;thanks for this soulution, works perfekt&lt;/P&gt;</description>
    <pubDate>Wed, 10 May 2017 10:54:58 GMT</pubDate>
    <dc:creator>ThomasControlw1</dc:creator>
    <dc:date>2017-05-10T10:54:58Z</dc:date>
    <item>
      <title>How to populate dropdown input with ids from search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-populate-dropdown-input-with-ids-from-search/m-p/147296#M41170</link>
      <description>&lt;P&gt;Can anyone please help me to populate a Dropdown input with the ids from this this search:&lt;BR /&gt;
index=main sourcetype=mainperfomance ChannelCode="*"&lt;BR /&gt;
I need to make a table that auto searches registers within the selected channels...&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2014 15:11:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-populate-dropdown-input-with-ids-from-search/m-p/147296#M41170</guid>
      <dc:creator>vtsguerrero</dc:creator>
      <dc:date>2014-07-17T15:11:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to populate dropdown input with ids from search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-populate-dropdown-input-with-ids-from-search/m-p/147297#M41171</link>
      <description>&lt;P&gt;A quick way would be to populate the drop down from a populatingSearch (below). This example terminates the populating search once 1000 values are retrieved (via the "head 1000" command). &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;populate_dropdown_from_search&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="dropdown" token="channel_code"&amp;gt;
      &amp;lt;label&amp;gt;Name:&amp;lt;/label&amp;gt;
      &amp;lt;populatingSearch fieldForLabel="name" fieldForValue="name"&amp;gt;index=main sourcetype=mainperfomance ChannelCode=* | head 1000 | stats count by ChannelCode | fields - count&amp;lt;/populatingSearch&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;event&amp;gt;
        &amp;lt;searchString&amp;gt;index=main sourcetype=mainperfomance ChannelCode=$channel_code$&amp;lt;/searchString&amp;gt;
        &amp;lt;earliestTime/&amp;gt;
        &amp;lt;latestTime/&amp;gt;
      &amp;lt;/event&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;A more robust solution is to define a lookup and then create a scheduled saved search that updates that lookup file. That file is updated by a search similar to the populating search. The lookup can then be used to populate the dropdown box quickly. Using a search that appends the lookup with new values makes the list more robust over time:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main sourcetype=mainperfomance ChannelCode=* 
| inputlookup append=t channel_codes
| stats count by ChannelCode
| fields - count
| outputlookup channel_codes
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...then you would modify the dashboard to load the results from that looup file:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;populatingSearch fieldForLabel="name" fieldForValue="name"&amp;gt;| inputlookup channel_codes&amp;lt;/populatingSearch&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Jul 2014 23:27:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-populate-dropdown-input-with-ids-from-search/m-p/147297#M41171</guid>
      <dc:creator>bwooden</dc:creator>
      <dc:date>2014-07-17T23:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to populate dropdown input with ids from search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-populate-dropdown-input-with-ids-from-search/m-p/147298#M41172</link>
      <description>&lt;P&gt;If you're using latest version of Splunk, much of the work (creating the form, adding the dropdown, adding a populating search, etc) can be done via the UI's dashboard editor. Additionally, this app has many great Simple XML dashboard examples: &lt;A href="http://apps.splunk.com/app/1603/"&gt;http://apps.splunk.com/app/1603/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2014 23:32:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-populate-dropdown-input-with-ids-from-search/m-p/147298#M41172</guid>
      <dc:creator>bwooden</dc:creator>
      <dc:date>2014-07-17T23:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to populate dropdown input with ids from search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-populate-dropdown-input-with-ids-from-search/m-p/147299#M41173</link>
      <description>&lt;P&gt;thanks for this soulution, works perfekt&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 10:54:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-populate-dropdown-input-with-ids-from-search/m-p/147299#M41173</guid>
      <dc:creator>ThomasControlw1</dc:creator>
      <dc:date>2017-05-10T10:54:58Z</dc:date>
    </item>
  </channel>
</rss>

