Archive
Highlighted

Dynamically populating dropdown and receving the error "duplicate labels causing conflict"

Communicator

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

Highlighted

Re: Dynamically populating dropdown and receving the error "duplicate labels causing conflict"

Legend

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>
Highlighted

Re: Dynamically populating dropdown and receving the error "duplicate labels causing conflict"

Communicator

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. 😞

0 Karma
Highlighted

Re: Dynamically populating dropdown and receving the error "duplicate labels causing conflict"

Legend

Try removing the static value (All). See if that makes a difference

0 Karma
Highlighted

Re: Dynamically populating dropdown and receving the error "duplicate labels causing conflict"

Communicator

No difference

0 Karma
Highlighted

Re: Dynamically populating dropdown and receving the error "duplicate labels causing conflict"

Legend

And you confirmed when you run this search outside of dropdown, you get unique list of DatabaseName? Can you share your BASE SEARCH

0 Karma
Highlighted

Re: Dynamically populating dropdown and receving the error "duplicate labels causing conflict"

Communicator

My base search is like this: i cannot share more:

index=something sourcetype=somthing_else

Yes, I can confirm that the names are unique.

0 Karma
Highlighted

Re: Dynamically populating dropdown and receving the error "duplicate labels causing conflict"

Legend

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

0 Karma
Highlighted

Re: Dynamically populating dropdown and receving the error "duplicate labels causing conflict"

Splunk Employee
Splunk Employee

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.

0 Karma
Highlighted

Re: Dynamically populating dropdown and receving the error "duplicate labels causing conflict"

Communicator

Same error 😞

0 Karma