Dashboards & Visualizations

Dependent dropdpwn in dashboard

snigdhasaxena
Communicator

I have two fields, event category (token name for this is category) and name(token name name_tok) for 2 different dropdowns.

Now if I select category as Car I want to see options like suv, xuv, hatchback in name dropdown.
If I select category bike I want to see options like pulsar, passion, stunner in namedropdown.

I have created a lookup, Actionlookup and build the below query:

index=abc Event_vehicle=$category$|lookup Actionlookup Event_vehicle as Event_vehicle OUTPUT values(NAME) as newname |dedup newname| table Event_vehicle newname

Note field name is same in lookup file and events for field, Event_vehicle

But the dropdown for name doesn't work

Tags (1)
0 Karma

jitendragupta
Path Finder

Check This Code:

<form>
  <label>dropdown demo</label>
  <fieldset submitButton="false">
    <input type="dropdown" token="category">
      <label>event category</label>
      <choice value="Car">Car</choice>
      <choice value="Bike">Bike</choice>
      <default>Car</default>
      <initialValue>Car</initialValue>
    </input>
    <input type="dropdown" token="name_tok">
      <label>name</label>
      <fieldForLabel>a</fieldForLabel>
      <fieldForValue>a</fieldForValue>
      <search>
        <query>| makeresults | eval category="Car" | eval a=if(category="$category$","suv,xuv,hatchback ","pulsar,passion,stunner") | eval a=split(a,",") | mvexpand a | table a</query>
        <earliest>-24h@h</earliest>
        <latest>now</latest>
      </search>
    </input>
  </fieldset>
</form>
0 Karma

paramagurukarth
Builder

can you provide your xml fieldset part

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...