I have a dropdown that has dynamic data, changes by the day, that I want filled in the dropdown for selection and use in the dashboard. I've followed several entries from the community but the dropdown is blank, only showing the ALL from the 'choice' entry. Here is the SPL,
<fieldset submitButton="true">
<input type="dropdown" token="tok_site" searchWhenChanged="false">
<label>Site</label>
<search>
<query>earliest=-2h index=asset sourcetype=Armis:Asset
| stats count by site.name
</query>
</search>
<choice value="*">ALL</choice>
<default>*</default>
<fieldForLabel>Site</fieldForLabel>
<fieldForValue>Site</fieldForValue>
</input>
</fieldset>
I will be adding a couple more dropdowns later, but they are dynamic as well. If I can't get one to work, well..
Any suggestion on where I've made a mistake?
The SPL <fieldForLabel> and <fieldForValue> elements say the Site field should be used to populate the dropdown, but that field does not exist. The only fields produced by the query are count and site.name. If you change the SPL to make sure the field names in the dropdown exist then it should work.
The SPL <fieldForLabel> and <fieldForValue> elements say the Site field should be used to populate the dropdown, but that field does not exist. The only fields produced by the query are count and site.name. If you change the SPL to make sure the field names in the dropdown exist then it should work.
Yep, that was it, I changed the field value to site.name and it is working. Thanks for pointing that out!