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!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...