Dashboards & Visualizations

How to set up three dynamic dropdowns on dashboard in simple XML on Splunk 6.0.1?

gajananh999
Contributor

Dear All,

I am working dropdowns in my dashboard. I have country,state,city in my data. So my first drop down is country. Depending on selected country it should fill states from selected country in 2nd dropdown and depending on state selected it should fill city in 3rd dropdown. So may i know how to achieve this in splunk.

i am able to put dynamic values in dropdown. can anyone please help me here.

Thanks
Gajanan Hiroji

Tags (2)
1 Solution

somesoni2
SplunkTrust
SplunkTrust

Try this run anywhere sample (tested on 6.0.3, may work for 6.0.1 as well)

<form>
  <label>Cascading dropdown</label>
  <description/>
  <fieldset submitButton="false" autoRun="true">
        <input type="dropdown" token="varSourcetype" id="field1">       
          <label>SourceType :</label>
            <populatingSearch fieldForValue="sourcetype" fieldForLabel="sourcetype">
                <![CDATA[index=_internal earliest=-1h@h | top 1 sourcetype | table sourcetype ]]>
            </populatingSearch>
        </input>
    <input type="dropdown" token="varSource" id="field2">
            <label>Source :</label>         
            <populatingSearch fieldForValue="source" fieldForLabel="source">
                <![CDATA[index=_internal earliest=-1h@h sourcetype=$varSourcetype$ | stats count by source ]]>
            </populatingSearch>
        </input>
     <input type="dropdown" token="varComponent" id="field3">
            <label>Source :</label>         
            <populatingSearch fieldForValue="component" fieldForLabel="component">
                <![CDATA[index=_internal earliest=-1h@h sourcetype=$varSourcetype$ source=$varSource$| stats count by component ]]>
            </populatingSearch>
        </input>    
  </fieldset>

 <row>
    <table>
    <title>Volume distribution- sourcetype=$varSourcetype$ source=$varSource$ component=$varComponent$</title>
      <searchString>
        <![CDATA[index=_internal earliest=-1h@h sourcetype=$varSourcetype$ source=$varSource$
          component=$varComponent$| timechart span=5m count ]]>
      </searchString>
      <option name="count">10</option>
      <option name="previewResults">true</option>
      <option name="drilldown">none</option>
    </table>
  </row>
 </form>

View solution in original post

somesoni2
SplunkTrust
SplunkTrust

Try this run anywhere sample (tested on 6.0.3, may work for 6.0.1 as well)

<form>
  <label>Cascading dropdown</label>
  <description/>
  <fieldset submitButton="false" autoRun="true">
        <input type="dropdown" token="varSourcetype" id="field1">       
          <label>SourceType :</label>
            <populatingSearch fieldForValue="sourcetype" fieldForLabel="sourcetype">
                <![CDATA[index=_internal earliest=-1h@h | top 1 sourcetype | table sourcetype ]]>
            </populatingSearch>
        </input>
    <input type="dropdown" token="varSource" id="field2">
            <label>Source :</label>         
            <populatingSearch fieldForValue="source" fieldForLabel="source">
                <![CDATA[index=_internal earliest=-1h@h sourcetype=$varSourcetype$ | stats count by source ]]>
            </populatingSearch>
        </input>
     <input type="dropdown" token="varComponent" id="field3">
            <label>Source :</label>         
            <populatingSearch fieldForValue="component" fieldForLabel="component">
                <![CDATA[index=_internal earliest=-1h@h sourcetype=$varSourcetype$ source=$varSource$| stats count by component ]]>
            </populatingSearch>
        </input>    
  </fieldset>

 <row>
    <table>
    <title>Volume distribution- sourcetype=$varSourcetype$ source=$varSource$ component=$varComponent$</title>
      <searchString>
        <![CDATA[index=_internal earliest=-1h@h sourcetype=$varSourcetype$ source=$varSource$
          component=$varComponent$| timechart span=5m count ]]>
      </searchString>
      <option name="count">10</option>
      <option name="previewResults">true</option>
      <option name="drilldown">none</option>
    </table>
  </row>
 </form>

gajananh999
Contributor

Thanks that works for me

0 Karma

gajananh999
Contributor

6.0.1..... simple xml

0 Karma

somesoni2
SplunkTrust
SplunkTrust

Version of splunk you're using? simple xml or advanced xml?

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...