Splunk Search

Duplicate values causing conflict

splunk_UCL
Explorer

Hi Splunkers,

below form (dynamic dropdown) creates "Duplicate values causing conflict"
Any ideas?

<form> 
  <label>test</label>
  <fieldset submitButton="false">
    <input type="time" searchWhenChanged="true" token="time">
      <default>
        <earliest>-24h@h</earliest>
        <latest>now</latest>
      </default>
    </input>

  <input type="dropdown" token="source" searchWhenChanged="true">
            <choice value="*">All</choice>
            <search>
                <query>index=_internal | top date_second | dedup date_second | table date_second</query>
          <earliest>$time.earliest$</earliest>
          <latest>$time.latest$</latest>
            </search>
  </input>

  </fieldset>
</form>
0 Karma

cmerriman
Super Champion

you shouldn't need the |dedup date_second as the |top date_second wouldn't bring in duplicate values.

try this:

<input type="dropdown" token="source" searchWhenChanged="true">
      <label>source</label>
      <choice value="*">All</choice>
      <search>
        <query>index=_internal | top date_second | table date_second</query>
           <earliest>$time.earliest$</earliest>
           <latest>$time.latest$</latest>
      </search>
      <fieldForLabel>date_second</fieldForLabel>
      <fieldForValue>date_second</fieldForValue>
    </input>
0 Karma

splunk_UCL
Explorer
     <form> 
       <label>deleteme</label>
       <fieldset submitButton="false">
         <input type="time" searchWhenChanged="true" token="time">
           <default>
             <earliest>-24h@h</earliest>
             <latest>now</latest>
           </default>
         </input>

       <input type="dropdown" token="source" searchWhenChanged="true">
                 <choice value="*">All</choice>
                       <fieldForLabel>date_second</fieldForLabel>
                       <fieldForValue>date_second</fieldForValue>
                 <search>
                     <query>index=_internal | top date_second | dedup date_second | table date_second</query>
               <earliest>$time.earliest$</earliest>
               <latest>$time.latest$</latest>
                 </search>
       </input>

       </fieldset>
     </form>

splunk_UCL
Explorer

found out by myself.

fieldForLabel and fieldForValue

were missing

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...