Archive

Dependent dropdpwn in dashboard

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

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

can you provide your xml fieldset part

0 Karma