Dashboards & Visualizations

How to use depend and reject use on input type dropdown and text?

karthi2809
Builder

Thanks in Advance.

I have four inputs Time,Environment,Application Name and Interface Name and two panels one is fiance and bank.Both panels has different applications name and interface names.So i tried to use depends and reject in the inputs.If i change one panel to another the inputs like dropdown and text box remains same but the values need to be change as per the panels.

<row>
    <panel id="panel_layout">
      <input id="input_link_split_by" type="link" token="tokSplit" searchWhenChanged="true">
        <label></label>
        <choice value="Finance">OVERVIEW</choice>
        <choice value="BankIntegrations">BANKS</choice>
        <default>OVERVIEW</default>
        <initialValue>OVERVIEW</initialValue>
        <change>
          <condition label="Finance">
            <set token="Finance">true</set>
            <unset token="BankIntegrations"></unset>
          </condition>
          <condition label="BankIntegrations">
            <set token="BankIntegrations">true</set>
            <unset token="Finance"></unset>
          </condition>
<row>
    <panel>
      <input type="time" token="time" searchWhenChanged="true">
        <label>Time Interval</label>
        <default>
          <earliest>-15m</earliest>
          <latest>now</latest>
        </default>
      </input>
      <input type="dropdown" token="env" searchWhenChanged="true">
        <label>Environment</label>
        <choice value="*">ALL</choice>
        <choice value="DEV">DEV</choice>
        <choice value="TEST">TEST</choice>
        <choice value="PRD">PRD</choice>
        <default>*</default>
        <initialValue>*</initialValue>
      </input>
      <input type="dropdown" token="applicationName" searchWhenChanged="true" depends="$Finance$" rejects="$BankIntegrations$">
        <label>ApplicationName</label>
        <choice value="*">ALL</choice>
        <choice value="p-wd-finance-api">p-wd-finance-api</choice>
        <default>"p-wd-finance-api</default>
        <initialValue>p-oracle-fin-processor","p-oracle-fin-processor-2","p-wd-finance-api</initialValue>
        <fieldForLabel>ApplicationName</fieldForLabel>
        <fieldForValue>ApplicationName</fieldForValue>
      </input>
      <input type="text" token="InterfaceName" searchWhenChanged="true" depends="$Finance$"  rejects="$BankIntegrations$">
        <label>InterfaceName</label>
        <default></default>
        <initialValue></initialValue>
      </input>
       <input type="dropdown" token="applicationName" searchWhenChanged="true" depends="$BankIntegrations$"  rejects="$Finance$">
        <label>ApplicationName</label>
        <choice value="p-wd-finance-api">p-wd-finance-api</choice>
        <default>p-oracle-fin-processor","p-oracle-fin-processor-2","p-wd-finance-api</default>
        <initialValue>p-oracle-fin-processor","p-oracle-fin-processor-2","p-wd-finance-api</initialValue>
        <fieldForLabel>ApplicationName</fieldForLabel>
        <fieldForValue>ApplicationName</fieldForValue>
      </input>
      <input type="text" token="InterfaceName" searchWhenChanged="true" depends="$BankIntegrations$" rejects="$Finance$">
        <label>InterfaceName</label>
        <default></default>
        <initialValue></initialValue>
      </input>
    </panel>
  </row>

 

Labels (2)
0 Karma

renjith_nair
Legend

@karthi2809 

Try this example. 

Changes : While setting the token on the change event, you should use the values . 

PS : Added a token to the Interface text to demonstrate the changes.

 

<form version="1.1" theme="light">
  <label>Depends_Rejects</label>
  <fieldset submitButton="false"></fieldset>
  <row>
    <panel id="panel_layout">
      <input id="input_link_split_by" type="link" token="tokSplit" searchWhenChanged="true">
        <label></label>
        <choice value="Finance">OVERVIEW</choice>
        <choice value="BankIntegrations">BANKS</choice>
        <default>OVERVIEW</default>
        <initialValue>OVERVIEW</initialValue>
        <change>
          <condition value="Finance">
            <set token="Finance">$value$</set>
            <unset token="BankIntegrations"></unset>
          </condition>
          <condition value="BankIntegrations">
            <set token="BankIntegrations">$value$</set>
            <unset token="Finance"></unset>
          </condition>
        </change>
      </input>
    </panel>
  </row>
  <row>
    <panel>
      <input type="time" token="time" searchWhenChanged="true">
        <label>Time Interval</label>
        <default>
          <earliest>-15m</earliest>
          <latest>now</latest>
        </default>
      </input>
      <input type="dropdown" token="env" searchWhenChanged="true">
        <label>Environment</label>
        <choice value="*">ALL</choice>
        <choice value="DEV">DEV</choice>
        <choice value="TEST">TEST</choice>
        <choice value="PRD">PRD</choice>
        <default>*</default>
        <initialValue>*</initialValue>
      </input>
      <input type="dropdown" token="applicationName" searchWhenChanged="true" depends="$Finance$" rejects="$BankIntegrations$">
        <label>ApplicationName</label>
        <choice value="*">ALL</choice>
        <choice value="p-wd-finance-api">p-wd-finance-api</choice>
        <default>"p-wd-finance-api</default>
        <initialValue>p-oracle-fin-processor","p-oracle-fin-processor-2","p-wd-finance-api</initialValue>
        <fieldForLabel>ApplicationName</fieldForLabel>
        <fieldForValue>ApplicationName</fieldForValue>
      </input>
      <input type="text" token="InterfaceName" searchWhenChanged="true" depends="$Finance$" rejects="$BankIntegrations$">
        <label>InterfaceName</label>
        <default>$tokSplit$</default>
        <initialValue></initialValue>
      </input>
      <input type="dropdown" token="applicationName" searchWhenChanged="true" depends="$BankIntegrations$" rejects="$Finance$">
        <label>ApplicationName</label>
        <choice value="p-wd-finance-api">p-wd-finance-api</choice>
        <default>p-oracle-fin-processor","p-oracle-fin-processor-2","p-wd-finance-api</default>
        <initialValue>p-oracle-fin-processor","p-oracle-fin-processor-2","p-wd-finance-api</initialValue>
        <fieldForLabel>ApplicationName</fieldForLabel>
        <fieldForValue>ApplicationName</fieldForValue>
      </input>
      <input type="text" token="InterfaceName" searchWhenChanged="true" depends="$BankIntegrations$" rejects="$Finance$">
        <label>InterfaceName</label>
        <default>$tokSplit$</default>
        <initialValue></initialValue>
      </input>
    </panel>
  </row>
</form>

 

 

Hope it helps!

---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma
Get Updates on the Splunk Community!

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

 Prepare to elevate your security operations with the powerful upgrade to Splunk Enterprise Security 8.x! This ...

Get Early Access to AI Playbook Authoring: Apply for the Alpha Private Preview ...

Passionate about security automation? Apply now to our AI Playbook Authoring Alpha private preview ...

Reduce and Transform Your Firewall Data with Splunk Data Management

Managing high-volume firewall data has always been a challenge. Noisy events and verbose traffic logs often ...