Hi
<input type="dropdown" token="c" searchWhenChanged="true">
<label>Cube</label>
<search>
<query>BASE SEARCH | stats count by DatabaseName</query>
<earliest>@w0</earliest>
<latest>now</latest>
</search>
<fieldForLabel>clabel</fieldForLabel>
<fieldForValue>cvalue</fieldForValue>
<choice value="*">All</choice>
<default>*</default>
<initialValue>*</initialValue>
</input>
I have this code for dynamically populating my dropdown but I'm still getting the error
duplicate labels causing conflict
I checked 100 times on but using stats count by DatabaseName should be the correct way.
Any idea on why I'm getting this error?
Thanks
Try to insert
| fields DatabaseName
at the end of your search or something like this
BASE SEARCH | eval DatabaseName=upper(DatabaseName) | dedup DatabaseName | sort DatabaseName | table DatabaseName
Bye.
Giuseppe
I discovered that the error depended by field for value and for label.
If I changefrom this:
clabel
<fieldForValue>cvalue</fieldForValue>
to this:
<fieldForLabel>DatabaseName</fieldForLabel>
<fieldForValue>DatabaseName</fieldForValue>
It works and I don't know why.
I thought that the 2 fields have to be that same, but if I chenge like this:
<fieldForLabel>DatabaseNameeeeeee</fieldForLabel>
<fieldForValue>DatabaseName</fieldForValue>
it works, but like this:
<fieldForLabel>bla</fieldForLabel>
<fieldForValue>bla</fieldForValue>
It does not work.
Can you tell me why?
Same error 😞
Hint: Better to use fields instead of table at the end of this search. table does a lot of work for UI formatting, which is not needed anywhere you don't want to render a table.
Try this
<input type="dropdown" token="c" searchWhenChanged="true">
<label>Cube</label>
<search>
<query>BASE SEARCH | eval DatabaseName=upper(DatabaseName) | stats count by DatabaseName</query>
<earliest>@w0</earliest>
<latest>now</latest>
</search>
<fieldForLabel>DatabaseName</fieldForLabel>
<fieldForValue>DatabaseName</fieldForValue>
<choice value="*">All</choice>
<default>*</default>
<initialValue>*</initialValue>
</input>
Same error, as the query I first posted, if run a simple search everything works.
When i put the search in the dropdown I get that error. 😞
Try removing the static value (All). See if that makes a difference
No difference
And you confirmed when you run this search outside of dropdown, you get unique list of DatabaseName? Can you share your BASE SEARCH
My base search is like this: i cannot share more:
index=something sourcetype=somthing_else
Yes, I can confirm that the names are unique.