Dashboards & Visualizations

Duplicate values on dropdown multiselect input

MeMilo09
Path Finder

Hello All,

I keep getting duplicates on my values for multiselect dropdown. I made sure my fields were correct the - field for name and field for values and query on the search.  Not sure what else I need to check for. My source below... Any advise is welcome. 

 

<input type="multiselect" token="tok_space_name" searchWhenChanged="true">

      <label>Select Space</label>

      <choice value="*">All</choice>

      <default>*</default>

      <prefix>(</prefix>

      <suffix>)</suffix>

      <valuePrefix>space_name="</valuePrefix>

      <valueSuffix>"</valueSuffix>

      <delimiter> OR </delimiter>

      <fieldForLabel>Select Space</fieldForLabel>

      <fieldForValue>space_name</fieldForValue>

      <search>

        <query>index="lll_soruceIdx.idx"  | stats values(space_name) as space_name | mvexpand space_name</query>

        <earliest>$time_range.earliest$</earliest>

        <latest>$time_range.latest$</latest>

      </search>

 

 

 

Labels (2)
0 Karma

bowesmana
SplunkTrust
SplunkTrust

Your '<fieldForLabel> should be a field in the data from your search to use as the visible dropdown, not the text

'Space Label', so change it to space_name

Also your search is probably better as

index="lll_soruceIdx.idx" 
| stats count by space_name 

so you don't first collapse all spaces and then expand them again.

 

0 Karma

vikasjha001
Engager

Could you try adding below command as well in the end of the search query. This should remove any duplicate entries for space_name


| dedup space_name 

 

Regards,

Vikas Jha

Tags (1)
0 Karma
Get Updates on the Splunk Community!

Now Available: Cisco Talos Threat Intelligence Integrations for Splunk Security Cloud ...

At .conf24, we shared that we were in the process of integrating Cisco Talos threat intelligence into Splunk ...

Preparing your Splunk Environment for OpenSSL3

The Splunk platform will transition to OpenSSL version 3 in a future release. Actions are required to prepare ...

Easily Improve Agent Saturation with the Splunk Add-on for OpenTelemetry Collector

Agent Saturation What and Whys In application performance monitoring, saturation is defined as the total load ...