Splunk Search

How to set one dropdown to default value (for ex: All) when i select values from the 2nd dropdown

rijinc
Explorer

there are two computed dropdown, just in case i select values from one dropdown the other dropdown should be reset to default(all) and vice versa.

I was entering something like this :

    <label>Deal Size</label>
    <default>*</default>
    <prefix>"</prefix>
    <suffix>"</suffix>
    <fieldForLabel>DealSize</fieldForLabel>
    <fieldForValue>DealSize</fieldForValue>
    <search>
      <query>| stats count by DealSize | dedup DealSize | fields DealSize</query>
    </search>
    <initialValue>*</initialValue>
    <choice value="*">All</choice>
     **<change>
     <set token="form.Fiscal_Year">*</set>
    </change>**
  </input>
  <input type="dropdown" token="Fiscal_Year" searchWhenChanged="true">
    <label>Fiscal Year</label>
    <default>All</default>
    <prefix>"</prefix>
    <suffix>"</suffix>
    <fieldForLabel>Fiscal_Year</fieldForLabel>
    <fieldForValue>Fiscal_Year</fieldForValue>
    <search>
      <query>| stats count by Fiscal_Year | dedup Fiscal_Year | fields Fiscal_Year</query>
    </search>
    <initialValue>*</initialValue>
    <choice value="*">All</choice>
     **<change>
<set token="form.DealSize">*</set>
    </change>**
  </input>

this is not getting set vice versa ...please let me know how this is possible ?

Tags (1)

niketn
Legend

Please add condition block to set the other dropdown as asterisk (*) only if the selected value in the current dropdown is not asterisk (*) i.e. <condition match="$value$!=&quot;*&quot;">

    <input type="dropdown" token="DealSize" searchWhenChanged="true">
     <label>Deal Size</label>
     <default>*</default>
     <prefix>"</prefix>
     <suffix>"</suffix>
     <fieldForLabel>DealSize</fieldForLabel>
     <fieldForValue>DealSize</fieldForValue>
     <search>
       <query>| stats count by DealSize | dedup DealSize | fields DealSize</query>
     </search>
     <initialValue>*</initialValue>
     <choice value="*">All</choice>
      <change>
        <condition match="$value$!=&quot;*&quot;">
          <set token="form.Fiscal_Year">*</set>
        </condition>
      </change>
    </input>
   <input type="dropdown" token="Fiscal_Year" searchWhenChanged="true">
     <label>Fiscal Year</label>
     <default>All</default>
     <prefix>"</prefix>
     <suffix>"</suffix>
     <fieldForLabel>Fiscal_Year</fieldForLabel>
     <fieldForValue>Fiscal_Year</fieldForValue>
     <search>
       <query>| stats count by Fiscal_Year | dedup Fiscal_Year | fields Fiscal_Year</query>
     </search>
     <initialValue>*</initialValue>
      <change>
        <condition match="$value$!=&quot;*&quot;">
          <set token="form.DealSize">*</set>
        </condition>
      </change>      
    </input>
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...