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!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...