Dashboards & Visualizations

Why is only one of 3 dynamic drop downs getting populated?

jtotzek
Explorer

I have 3 dynamic dropdowns in my panel. I need to do my search on them but only the first dropdown is populated. If I use the search from them individually, I can get results. What is my mistake?

Sorry for the newbie question!

 <form>
  <label>Main</label>
  <fieldset submitButton="false" autoRun="true"></fieldset>
  <row>
    <panel>
      <input type="dropdown" token="source">
        <label>Scan Name</label>
        <search>
          <query>index=discovery_data | dedup "source"</query>
          <earliest>@d</earliest>
          <latest>now</latest>
        </search>
        <fieldForLabel>source</fieldForLabel>
        <fieldForValue>source</fieldForValue>
        <choice value="*">all</choice>
        <default>*</default>
      </input>
      <input type="dropdown" token="in_input_domains">
        <label>In Input Domains</label>
        <search>
          <query>index=discovery_data | dedup "In Input Domain"</query>
          <earliest>@d</earliest>
          <latest>now</latest>
        </search>
        <fieldForLabel>in_input_domains</fieldForLabel>
        <fieldForValue>in_input_domains</fieldForValue>
        <choice value="*">all</choice>
        <default>*</default>
      </input>
      <input type="dropdown" token="in_input_ips">
        <label>In Input IP's</label>
        <search>
          <query>index=discovery_data | dedup "In Input IP Range"</query>
          <earliest>@d</earliest>
          <latest>now</latest>
        </search>
        <fieldForLabel>in_input_ips</fieldForLabel>
        <fieldForValue>in_input_ips</fieldForValue>
        <choice value="*">all</choice>
        <default>*</default>
      </input>
      <table>
        <title>Domains found when</title>
        <search>
          <query>index="discovery_data" source=$source$ "In Input Domain"=$in_input_domains$ "In Input IP Range"=$in_input_ips$ | dedup "Host Display" | table "Host Display" "Time Found" "source"</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">none</option>
      </table>
    </panel>
  </row>
</form>
0 Karma
1 Solution

renjith_nair
SplunkTrust
SplunkTrust

@jtotzek,

In the second and third dropdown boxes, you have the fields "In Input Domain" and "In Input IP Range" respectively which are not matching with the respective fieldForValue and fieldForLabel. These properties look for the fields from the search itself. Try renaming this fields in the search and use them. Also index=discovery_data |stats countby "your fieldname" might be faster than dedup. Just give it a try

Example :

<input type="dropdown" token="in_input_ips">
         <label>In Input IP's</label>
         <search>
           <query>index=discovery_data | stats count by "In Input IP Range"|rename "In Input IP Range"  as in_input_ips </query>
           <earliest>@d</earliest>
           <latest>now</latest>
         </search>
         <fieldForLabel>in_input_ips</fieldForLabel>
         <fieldForValue>in_input_ips</fieldForValue>
         <choice value="*">all</choice>
         <default>*</default>
       </input>
Happy Splunking!

View solution in original post

renjith_nair
SplunkTrust
SplunkTrust

@jtotzek,

In the second and third dropdown boxes, you have the fields "In Input Domain" and "In Input IP Range" respectively which are not matching with the respective fieldForValue and fieldForLabel. These properties look for the fields from the search itself. Try renaming this fields in the search and use them. Also index=discovery_data |stats countby "your fieldname" might be faster than dedup. Just give it a try

Example :

<input type="dropdown" token="in_input_ips">
         <label>In Input IP's</label>
         <search>
           <query>index=discovery_data | stats count by "In Input IP Range"|rename "In Input IP Range"  as in_input_ips </query>
           <earliest>@d</earliest>
           <latest>now</latest>
         </search>
         <fieldForLabel>in_input_ips</fieldForLabel>
         <fieldForValue>in_input_ips</fieldForValue>
         <choice value="*">all</choice>
         <default>*</default>
       </input>
Happy Splunking!

jtotzek
Explorer

thanks a lot, didn't recognized that it needs to match the query!

0 Karma

jtotzek
Explorer

thanks a lot, didn't recognized that it needs to match the query!

0 Karma

renjith_nair
SplunkTrust
SplunkTrust

@jtotzek, you are welcome. Please accept as answer if you don't have further question to close the thread

Happy Splunking!
0 Karma

renjith_nair
SplunkTrust
SplunkTrust

@jtotzek, do you have any other question on this ? If not, kindly accept as answer.

Happy Splunking!
0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...