Dashboards & Visualizations

Text input tokens that depend on each other

gustavlundberg
New Member

Hello,

I am working on a dashboard with two text inputs, with tokens "ID_token" and "application_token". I need application_token to depend on the value of ID_token in the following way:

If ID_token=*
then application_token=app_X

Else (ID_token != *)
then application_token=*

I have written this as:

<fieldset submitButton="false">
    <input type="text" token="ID_token" searchWhenChanged="true">
      <label>ID</label>
      <change>
        <condition match="'value'==&quot;*&quot;">
          <set token="application_token">app_X</set>
        </condition>
        <condition>
          <set token="application_token">*</set>
        </condition>
      </change>
      <initialValue>*</initialValue>
      <default>*</default>
    </input>
    <input type="text" token="application_token" searchWhenChanged="true">
      <label>Application</label>
      <default>app_X</default>
    </input>
  </fieldset>

The problem is that when I search for an ID=1234, nothing happens to the application_token. It just keeps having the value "app_X" all the time.

Has anyone encountered a similar problem and found a solution?

0 Karma
1 Solution

vnravikumar
Champion

Hi

Try this, use form.application_token instead of application_token

<form>
   <fieldset submitButton="false">
     <input type="text" token="ID_token" searchWhenChanged="true">
       <label>ID</label>
       <change>
         <condition match="'value'==&quot;*&quot;">
           <set token="form.application_token">app_X</set>
         </condition>
         <condition>
           <set token="form.application_token">*</set>
         </condition>
       </change>
       <initialValue>*</initialValue>
       <default>*</default>
     </input>
     <input type="text" token="application_token" searchWhenChanged="true">
       <label>Application</label>
       <default>app_X</default>
     </input>
   </fieldset>
</form>

View solution in original post

vnravikumar
Champion

Hi

Try this, use form.application_token instead of application_token

<form>
   <fieldset submitButton="false">
     <input type="text" token="ID_token" searchWhenChanged="true">
       <label>ID</label>
       <change>
         <condition match="'value'==&quot;*&quot;">
           <set token="form.application_token">app_X</set>
         </condition>
         <condition>
           <set token="form.application_token">*</set>
         </condition>
       </change>
       <initialValue>*</initialValue>
       <default>*</default>
     </input>
     <input type="text" token="application_token" searchWhenChanged="true">
       <label>Application</label>
       <default>app_X</default>
     </input>
   </fieldset>
</form>
Get Updates on the Splunk Community!

This Week's Community Digest - Splunk Community Happenings [9.26.22]

Get the latest news and updates from the Splunk Community here! Upcoming User Group Events! &#x1f44f; Check ...

BSides Splunk 2022 - The Call for Papers is now Open!

TLDR; Main Site: https://bsidessplunk.com CFP Site: https://bsidessplunk.com/cfp CFP Opens: December 15th, ...

Sending Metrics to Splunk Enterprise With the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. The OpenTelemetry project is the second largest ...