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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...