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!

See just what you’ve been missing | Observability tracks at Splunk University

Looking to sharpen your observability skills so you can better understand how to collect and analyze data from ...

Weezer at .conf25? Say it ain’t so!

Hello Splunkers, The countdown to .conf25 is on-and we've just turned up the volume! We're thrilled to ...

How SC4S Makes Suricata Logs Ingestion Simple

Network security monitoring has become increasingly critical for organizations of all sizes. Splunk has ...