Dashboards & Visualizations

How to set a drop-down default value for a linked form when used by itself?

rsxrox
Explorer

I currently have a form that is a destination form for a dashboard drilldown. Upon clicking a value on the pie chart on the dashboard, I'll be directed to this form with a token $version_remote$.

        <drilldown>
          <link>/app/myapp/destination_form?version_remote=$click.value$</link>
        </drilldown>

This form has an input drop-down. I've set the default value of this drop-down as the token from the source dashboard drilldown link ( $version_remote$)

  <input type="dropdown" token="version_local" searchWhenChanged="true">
      <label>Version:</label>
      <search>
        <query>index=myapp sourcetype=my_app_csv | stats count(app_id) by app_release| sort -app_release</query>
      </search>
      <fieldForLabel>app_release</fieldForLabel>
      <fieldForValue>app_release</fieldForValue>
      <choice value="*">All</choice>
      <default>$version_remote$</default>
    </input>

I'm also going to use this form by itself (not thru dashboard drilldown). When using the form by itself, I'd like the default value to be set to 'All'.

Can you please let me know how I can do this using the same form?

0 Karma
1 Solution

somesoni2
SplunkTrust
SplunkTrust

In the drilldown dashboard, keep the token name for the dropdown same as what is being passed from other dashboard and set the default to all. Something like this (remember to update all reference of version_local with version_remote)

<input type="dropdown" token="version_remote" searchWhenChanged="true">
       <label>Version:</label>
       <search>
         <query>index=myapp sourcetype=my_app_csv | stats count(app_id) by app_release| sort -app_release</query>
       </search>
       <fieldForLabel>app_release</fieldForLabel>
       <fieldForValue>app_release</fieldForValue>
       <choice value="*">All</choice>
       <default>All</default>
     </input>

View solution in original post

somesoni2
SplunkTrust
SplunkTrust

In the drilldown dashboard, keep the token name for the dropdown same as what is being passed from other dashboard and set the default to all. Something like this (remember to update all reference of version_local with version_remote)

<input type="dropdown" token="version_remote" searchWhenChanged="true">
       <label>Version:</label>
       <search>
         <query>index=myapp sourcetype=my_app_csv | stats count(app_id) by app_release| sort -app_release</query>
       </search>
       <fieldForLabel>app_release</fieldForLabel>
       <fieldForValue>app_release</fieldForValue>
       <choice value="*">All</choice>
       <default>All</default>
     </input>

rsxrox
Explorer

Cool, this worked. Only other change that I had to do was change the version_remote in drilldown tag in the source dashboard to form.version_remote, like below.
<link>/app/myapp/destination_form?form.version_remote=$click.value$</link>
</drilldown>

0 Karma
Get Updates on the Splunk Community!

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 ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...