<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: While creating dropdown getting &amp;quot;Duplicate values causing conflict&amp;quot; error in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/While-creating-dropdown-getting-quot-Duplicate-values-causing/m-p/420860#M74048</link>
    <description>&lt;P&gt;@xpac, I wanted to add to your second point that the query in the question returns only &lt;CODE&gt;productId&lt;/CODE&gt; field through final pipe &lt;CODE&gt;| productId&lt;/CODE&gt;. The &lt;CODE&gt;&amp;lt;fieldForLabel&amp;gt;&lt;/CODE&gt; and &lt;CODE&gt;&amp;lt;fieldForValue&amp;gt;&lt;/CODE&gt; options for dropdown must contain the field names returned in the Search Query if Dynamic Options are used for building choices for the dropdown. &lt;CODE&gt;If fields names do not match&lt;/CODE&gt; i.e. (1) either they are not present or (2) they have a different casing/name then it is expected behavior that Dropdown will show &lt;CODE&gt;Duplicate Values Causing Conflict&lt;/CODE&gt; error.&lt;/P&gt;

&lt;P&gt;Secondly,  just FYI, the &lt;CODE&gt;| fields&lt;/CODE&gt; command will retain the fields mentioned and also all internal fields with underscore ( &lt;CODE&gt;_&lt;/CODE&gt; ) i.e. &lt;CODE&gt;_time, _raw&lt;/CODE&gt; etc. So either they need to be explicitly removed with &lt;CODE&gt;| fields - _*&lt;/CODE&gt; or &lt;BR /&gt;
 &lt;CODE&gt;| table&lt;/CODE&gt; command can be used for specific fields.&lt;/P&gt;

&lt;P&gt;Ideally, as a fix following query should be used:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index="main" sourcetype="access_combined_wcookie" status="200" file="success.do" productName="*" productValue="*"
| dedup productValue 
| table productName productValue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The base search filters and &lt;CODE&gt;productName="*"&lt;/CODE&gt; and &lt;CODE&gt;productValue="*"&lt;/CODE&gt; ensure events with both fields present are returned. Since &lt;CODE&gt;productValue&lt;/CODE&gt; field is the &lt;CODE&gt;fieldForValue&lt;/CODE&gt;, it should be unique. Hence dedup is performed on productValue. If it is not, search query should have eval to create a unique value field i.e. something like &lt;CODE&gt;| eval productValue = productId."-".productValue&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;However, having said all these, @Anirban92Chakraborty you should check query with productName and productValue in independent search. Only if they are returning these unique records for productName and productValue you should use them.&lt;/P&gt;

&lt;P&gt;Based on the query provided are you using working with &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchTutorial/Systemrequirements#Download_the_tutorial_data_files"&gt;Buttercup Games Search Tutorial data from Splunk&lt;/A&gt;? I don't think productId field is available for &lt;CODE&gt;source="success.do"&lt;/CODE&gt;. Also &lt;CODE&gt;productName&lt;/CODE&gt; is not present in the raw events. Splunk Documentation provides it as &lt;CODE&gt;prices.csv&lt;/CODE&gt; lookup file to enrich product Ids with their corresponding names and prices. If it is so make sure you have the lookup file uploaded and lookup definition created. Even with the lookup file you should use &lt;CODE&gt;productId&lt;/CODE&gt; as &lt;CODE&gt;&amp;lt;fieldForValue&amp;gt;&lt;/CODE&gt; and &lt;CODE&gt;productName&lt;/CODE&gt; as &lt;CODE&gt;&amp;lt;fieldForName&amp;gt;&lt;/CODE&gt; as the field &lt;CODE&gt;productValue&lt;/CODE&gt; does not exist (unless you have created one).&lt;/P&gt;

&lt;P&gt;Please try out and provide further details if provided details do not work.&lt;/P&gt;</description>
    <pubDate>Sun, 27 May 2018 22:25:15 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2018-05-27T22:25:15Z</dc:date>
    <item>
      <title>While creating dropdown getting "Duplicate values causing conflict" error</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/While-creating-dropdown-getting-quot-Duplicate-values-causing/m-p/420858#M74046</link>
      <description>&lt;P&gt;I'm getting "Duplicate values causing conflict" error everytime, while I don't see any duplicate in the search result. I'm very new to Splunk. Product Id is the field that I need to count on&lt;/P&gt;

&lt;P&gt;Please find my XML below,&lt;/P&gt;

&lt;P&gt;Sales Dashbord&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="dropdown" token="product_id"&amp;gt;
  &amp;lt;label&amp;gt;product_id&amp;lt;/label&amp;gt;
  &amp;lt;fieldForLabel&amp;gt;productName&amp;lt;/fieldForLabel&amp;gt;
  &amp;lt;fieldForValue&amp;gt;productValue&amp;lt;/fieldForValue&amp;gt;
  &amp;lt;search&amp;gt;
    &amp;lt;query&amp;gt;index = main sourcetype=access_combined_wcookie status = 200 file = success.do | fields productId | dedup productId | table productId&amp;lt;/query&amp;gt;
    &amp;lt;earliest&amp;gt;0&amp;lt;/earliest&amp;gt;
    &amp;lt;latest&amp;gt;&amp;lt;/latest&amp;gt;
  &amp;lt;/search&amp;gt;
  &amp;lt;choice value="*"&amp;gt;All&amp;lt;/choice&amp;gt;
  &amp;lt;prefix&amp;gt;''&amp;lt;/prefix&amp;gt;
  &amp;lt;suffix&amp;gt;''&amp;lt;/suffix&amp;gt;
&amp;lt;/input&amp;gt;


&amp;lt;panel&amp;gt;
  &amp;lt;title&amp;gt;Product Sales&amp;lt;/title&amp;gt;
  &amp;lt;chart&amp;gt;
    &amp;lt;search&amp;gt;
      &amp;lt;query&amp;gt;index = main sourcetype=access_combined_wcookie status = 200 file = success.do | stats count by productId&amp;lt;/query&amp;gt;
      &amp;lt;earliest&amp;gt;0&amp;lt;/earliest&amp;gt;
      &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
    &amp;lt;/search&amp;gt;
    &amp;lt;option name="charting.axisLabelsX.majorLabelStyle.overflowMode"&amp;gt;ellipsisNone&amp;lt;/option&amp;gt;
    &amp;lt;option name="charting.axisLabelsX.majorLabelStyle.rotation"&amp;gt;0&amp;lt;/option&amp;gt;
    &amp;lt;option name="charting.axisTitleX.visibility"&amp;gt;visible&amp;lt;/option&amp;gt;
    &amp;lt;option name="charting.axisTitleY.visibility"&amp;gt;visible&amp;lt;/option&amp;gt;
    &amp;lt;option name="charting.axisTitleY2.visibility"&amp;gt;visible&amp;lt;/option&amp;gt;
    &amp;lt;option name="charting.axisX.abbreviation"&amp;gt;none&amp;lt;/option&amp;gt;
    &amp;lt;option name="charting.axisX.scale"&amp;gt;linear&amp;lt;/option&amp;gt;
    &amp;lt;option name="charting.axisY.abbreviation"&amp;gt;none&amp;lt;/option&amp;gt;
    &amp;lt;option name="charting.axisY.scale"&amp;gt;linear&amp;lt;/option&amp;gt;
    &amp;lt;option name="charting.axisY2.abbreviation"&amp;gt;none&amp;lt;/option&amp;gt;
    &amp;lt;option name="charting.axisY2.enabled"&amp;gt;0&amp;lt;/option&amp;gt;
    &amp;lt;option name="charting.axisY2.scale"&amp;gt;inherit&amp;lt;/option&amp;gt;
    &amp;lt;option name="charting.chart"&amp;gt;column&amp;lt;/option&amp;gt;
    &amp;lt;option name="charting.chart.bubbleMaximumSize"&amp;gt;50&amp;lt;/option&amp;gt;
    &amp;lt;option name="charting.chart.bubbleMinimumSize"&amp;gt;10&amp;lt;/option&amp;gt;
    &amp;lt;option name="charting.chart.bubbleSizeBy"&amp;gt;area&amp;lt;/option&amp;gt;
    &amp;lt;option name="charting.chart.nullValueMode"&amp;gt;gaps&amp;lt;/option&amp;gt;
    &amp;lt;option name="charting.chart.showDataLabels"&amp;gt;none&amp;lt;/option&amp;gt;
    &amp;lt;option name="charting.chart.sliceCollapsingThreshold"&amp;gt;0.01&amp;lt;/option&amp;gt;
    &amp;lt;option name="charting.chart.stackMode"&amp;gt;default&amp;lt;/option&amp;gt;
    &amp;lt;option name="charting.chart.style"&amp;gt;shiny&amp;lt;/option&amp;gt;
    &amp;lt;option name="charting.drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
    &amp;lt;option name="charting.layout.splitSeries"&amp;gt;0&amp;lt;/option&amp;gt;
    &amp;lt;option name="charting.layout.splitSeries.allowIndependentYRanges"&amp;gt;0&amp;lt;/option&amp;gt;
    &amp;lt;option name="charting.legend.labelStyle.overflowMode"&amp;gt;ellipsisMiddle&amp;lt;/option&amp;gt;
    &amp;lt;option name="charting.legend.mode"&amp;gt;standard&amp;lt;/option&amp;gt;
    &amp;lt;option name="charting.legend.placement"&amp;gt;right&amp;lt;/option&amp;gt;
    &amp;lt;option name="charting.lineWidth"&amp;gt;2&amp;lt;/option&amp;gt;
    &amp;lt;option name="trellis.enabled"&amp;gt;0&amp;lt;/option&amp;gt;
    &amp;lt;option name="trellis.scales.shared"&amp;gt;1&amp;lt;/option&amp;gt;
    &amp;lt;option name="trellis.size"&amp;gt;medium&amp;lt;/option&amp;gt;
  &amp;lt;/chart&amp;gt;
&amp;lt;/panel&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 27 May 2018 19:49:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/While-creating-dropdown-getting-quot-Duplicate-values-causing/m-p/420858#M74046</guid>
      <dc:creator>Anirban92Chakra</dc:creator>
      <dc:date>2018-05-27T19:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: While creating dropdown getting "Duplicate values causing conflict" error</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/While-creating-dropdown-getting-quot-Duplicate-values-causing/m-p/420859#M74047</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;

&lt;P&gt;try this for the query:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=main sourcetype=access_combined_wcookie status=200 file=success.do | fields productId | dedup productId&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;You should make sure that you don't have spaces around your &lt;CODE&gt;=&lt;/CODE&gt;. Also the &lt;CODE&gt;| table&lt;/CODE&gt; part is unneccessary.&lt;/P&gt;

&lt;P&gt;Also, you use these lines:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   &amp;lt;fieldForLabel&amp;gt;productName&amp;lt;/fieldForLabel&amp;gt;
   &amp;lt;fieldForValue&amp;gt;productValue&amp;lt;/fieldForValue&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but the &lt;CODE&gt;| fields productId&lt;/CODE&gt; removes all fields but &lt;CODE&gt;productID&lt;/CODE&gt;, so those fields are not available at all.&lt;/P&gt;

&lt;P&gt;So either - use &lt;CODE&gt;productId&lt;/CODE&gt; with those lines, or add those two fields to the &lt;CODE&gt;| fields&lt;/CODE&gt; command, like this:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=main sourcetype=access_combined_wcookie status=200 file=success.do | fields productId productName productValue | dedup productId&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Hope that helps - if it does I'd be happy if you would upvote/accept this answer, so others could profit from it. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 27 May 2018 21:08:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/While-creating-dropdown-getting-quot-Duplicate-values-causing/m-p/420859#M74047</guid>
      <dc:creator>xpac</dc:creator>
      <dc:date>2018-05-27T21:08:26Z</dc:date>
    </item>
    <item>
      <title>Re: While creating dropdown getting "Duplicate values causing conflict" error</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/While-creating-dropdown-getting-quot-Duplicate-values-causing/m-p/420860#M74048</link>
      <description>&lt;P&gt;@xpac, I wanted to add to your second point that the query in the question returns only &lt;CODE&gt;productId&lt;/CODE&gt; field through final pipe &lt;CODE&gt;| productId&lt;/CODE&gt;. The &lt;CODE&gt;&amp;lt;fieldForLabel&amp;gt;&lt;/CODE&gt; and &lt;CODE&gt;&amp;lt;fieldForValue&amp;gt;&lt;/CODE&gt; options for dropdown must contain the field names returned in the Search Query if Dynamic Options are used for building choices for the dropdown. &lt;CODE&gt;If fields names do not match&lt;/CODE&gt; i.e. (1) either they are not present or (2) they have a different casing/name then it is expected behavior that Dropdown will show &lt;CODE&gt;Duplicate Values Causing Conflict&lt;/CODE&gt; error.&lt;/P&gt;

&lt;P&gt;Secondly,  just FYI, the &lt;CODE&gt;| fields&lt;/CODE&gt; command will retain the fields mentioned and also all internal fields with underscore ( &lt;CODE&gt;_&lt;/CODE&gt; ) i.e. &lt;CODE&gt;_time, _raw&lt;/CODE&gt; etc. So either they need to be explicitly removed with &lt;CODE&gt;| fields - _*&lt;/CODE&gt; or &lt;BR /&gt;
 &lt;CODE&gt;| table&lt;/CODE&gt; command can be used for specific fields.&lt;/P&gt;

&lt;P&gt;Ideally, as a fix following query should be used:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index="main" sourcetype="access_combined_wcookie" status="200" file="success.do" productName="*" productValue="*"
| dedup productValue 
| table productName productValue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The base search filters and &lt;CODE&gt;productName="*"&lt;/CODE&gt; and &lt;CODE&gt;productValue="*"&lt;/CODE&gt; ensure events with both fields present are returned. Since &lt;CODE&gt;productValue&lt;/CODE&gt; field is the &lt;CODE&gt;fieldForValue&lt;/CODE&gt;, it should be unique. Hence dedup is performed on productValue. If it is not, search query should have eval to create a unique value field i.e. something like &lt;CODE&gt;| eval productValue = productId."-".productValue&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;However, having said all these, @Anirban92Chakraborty you should check query with productName and productValue in independent search. Only if they are returning these unique records for productName and productValue you should use them.&lt;/P&gt;

&lt;P&gt;Based on the query provided are you using working with &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchTutorial/Systemrequirements#Download_the_tutorial_data_files"&gt;Buttercup Games Search Tutorial data from Splunk&lt;/A&gt;? I don't think productId field is available for &lt;CODE&gt;source="success.do"&lt;/CODE&gt;. Also &lt;CODE&gt;productName&lt;/CODE&gt; is not present in the raw events. Splunk Documentation provides it as &lt;CODE&gt;prices.csv&lt;/CODE&gt; lookup file to enrich product Ids with their corresponding names and prices. If it is so make sure you have the lookup file uploaded and lookup definition created. Even with the lookup file you should use &lt;CODE&gt;productId&lt;/CODE&gt; as &lt;CODE&gt;&amp;lt;fieldForValue&amp;gt;&lt;/CODE&gt; and &lt;CODE&gt;productName&lt;/CODE&gt; as &lt;CODE&gt;&amp;lt;fieldForName&amp;gt;&lt;/CODE&gt; as the field &lt;CODE&gt;productValue&lt;/CODE&gt; does not exist (unless you have created one).&lt;/P&gt;

&lt;P&gt;Please try out and provide further details if provided details do not work.&lt;/P&gt;</description>
      <pubDate>Sun, 27 May 2018 22:25:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/While-creating-dropdown-getting-quot-Duplicate-values-causing/m-p/420860#M74048</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-05-27T22:25:15Z</dc:date>
    </item>
  </channel>
</rss>

