<?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: Result of subsearch field repeated instead of displaying unique values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Result-of-subsearch-field-repeated-instead-of-displaying-unique/m-p/310732#M163526</link>
    <description>&lt;P&gt;I'm getting a list of all the data for the fields I have specified in the query&lt;/P&gt;</description>
    <pubDate>Thu, 18 Jan 2018 09:56:04 GMT</pubDate>
    <dc:creator>mahbs</dc:creator>
    <dc:date>2018-01-18T09:56:04Z</dc:date>
    <item>
      <title>Result of subsearch field repeated instead of displaying unique values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Result-of-subsearch-field-repeated-instead-of-displaying-unique/m-p/310727#M163521</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a could of fields that contain multiple values, and I am trying to seperate them into sepereate records. The following query works 90%. The only issue is that the last field in the subsearch is not displaying the unique valeus, for example it may contain the value: 2,3 but it will only display 2. Every other field works fine in terms of displaying all the unique values  per record. This is the current query I have:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index sourcetype=csv source=src1 host=host1 
 | stats count by ITEM field2 field3 field4 
 | rename field2 as F_2 field3 as F_3 field4 as F_4 
 | join ITEM 
     [ search index=index sourcetype=csv source=src2 host=host2 
     | stats count by SKU c_2 c_3 c_4 
     | rename SKU as ITEM | rename c_2 as C_2 c_3as C_3 c_4as C_4 ] 
 | eval DIFF1=F2-C_2 
 | eval DIFF2=F_3-C_3 
 | sort limit=0 ITEM 
 | table ITEM, F_2, F_3, F_4, c_2, c_3, c_4, DIFF1, DIFF2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can someone suggest what I can do to fix the problem?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2018 09:26:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Result-of-subsearch-field-repeated-instead-of-displaying-unique/m-p/310727#M163521</guid>
      <dc:creator>mahbs</dc:creator>
      <dc:date>2018-01-18T09:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: Result of subsearch field repeated instead of displaying unique values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Result-of-subsearch-field-repeated-instead-of-displaying-unique/m-p/310728#M163522</link>
      <description>&lt;P&gt;could you specify in detail which subsearch is not displaying unique values and what is the output you are getting and what is expected?&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2018 09:34:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Result-of-subsearch-field-repeated-instead-of-displaying-unique/m-p/310728#M163522</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-01-18T09:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: Result of subsearch field repeated instead of displaying unique values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Result-of-subsearch-field-repeated-instead-of-displaying-unique/m-p/310729#M163523</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
yep, the sub-search is where source=src2. Essentially C_4has multiple values, and im trying to seperate these values into seperate records which is working for the most part, but c_4 for some reason isn't displaying all the multiple values, it's just repeating, where as all the other fields are displaying the multiple data.&lt;/P&gt;

&lt;P&gt;This is the output I want:&lt;BR /&gt;
ITEM: 1234  F_2=22 F_3=21 F_4=23 &lt;BR /&gt;
ITEM: 1234  C_2=1  C_3=2    C_4=2 &lt;/P&gt;

&lt;P&gt;I hope that makes sense&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:40:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Result-of-subsearch-field-repeated-instead-of-displaying-unique/m-p/310729#M163523</guid>
      <dc:creator>mahbs</dc:creator>
      <dc:date>2020-09-29T17:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: Result of subsearch field repeated instead of displaying unique values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Result-of-subsearch-field-repeated-instead-of-displaying-unique/m-p/310730#M163524</link>
      <description>&lt;P&gt;I'm not sure if the join is working properly&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2018 09:42:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Result-of-subsearch-field-repeated-instead-of-displaying-unique/m-p/310730#M163524</guid>
      <dc:creator>mahbs</dc:creator>
      <dc:date>2018-01-18T09:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: Result of subsearch field repeated instead of displaying unique values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Result-of-subsearch-field-repeated-instead-of-displaying-unique/m-p/310731#M163525</link>
      <description>&lt;P&gt;could you please run only subsearch i.e. &lt;/P&gt;

&lt;P&gt;search index=index sourcetype=csv source=src2 host=host2 &lt;BR /&gt;
      | stats count by SKU c_2 c_3 c_4 &lt;BR /&gt;
      | rename SKU as ITEM | rename c_2 as C_2 c_3 as C_3 c_4 as C_4&lt;/P&gt;

&lt;P&gt;what output you are getting and what is expeced... &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:44:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Result-of-subsearch-field-repeated-instead-of-displaying-unique/m-p/310731#M163525</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2020-09-29T17:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: Result of subsearch field repeated instead of displaying unique values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Result-of-subsearch-field-repeated-instead-of-displaying-unique/m-p/310732#M163526</link>
      <description>&lt;P&gt;I'm getting a list of all the data for the fields I have specified in the query&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2018 09:56:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Result-of-subsearch-field-repeated-instead-of-displaying-unique/m-p/310732#M163526</guid>
      <dc:creator>mahbs</dc:creator>
      <dc:date>2018-01-18T09:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: Result of subsearch field repeated instead of displaying unique values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Result-of-subsearch-field-repeated-instead-of-displaying-unique/m-p/310733#M163527</link>
      <description>&lt;P&gt;There's also  count column at the end&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2018 09:56:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Result-of-subsearch-field-repeated-instead-of-displaying-unique/m-p/310733#M163527</guid>
      <dc:creator>mahbs</dc:creator>
      <dc:date>2018-01-18T09:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: Result of subsearch field repeated instead of displaying unique values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Result-of-subsearch-field-repeated-instead-of-displaying-unique/m-p/310734#M163528</link>
      <description>&lt;P&gt;do you require count field else you should remove it using &lt;CODE&gt;|fields - count&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2018 10:07:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Result-of-subsearch-field-repeated-instead-of-displaying-unique/m-p/310734#M163528</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-01-18T10:07:17Z</dc:date>
    </item>
    <item>
      <title>Re: Result of subsearch field repeated instead of displaying unique values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Result-of-subsearch-field-repeated-instead-of-displaying-unique/m-p/310735#M163529</link>
      <description>&lt;P&gt;yeah but that's not the problem at the moment &lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2018 10:16:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Result-of-subsearch-field-repeated-instead-of-displaying-unique/m-p/310735#M163529</guid>
      <dc:creator>mahbs</dc:creator>
      <dc:date>2018-01-18T10:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: Result of subsearch field repeated instead of displaying unique values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Result-of-subsearch-field-repeated-instead-of-displaying-unique/m-p/310736#M163530</link>
      <description>&lt;P&gt;also why you are renaming same field in subsearch....else query looks fine ..if you could share dummy data for source=src2 and src1 then I can try &lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2018 10:21:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Result-of-subsearch-field-repeated-instead-of-displaying-unique/m-p/310736#M163530</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-01-18T10:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: Result of subsearch field repeated instead of displaying unique values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Result-of-subsearch-field-repeated-instead-of-displaying-unique/m-p/310737#M163531</link>
      <description>&lt;P&gt;if your fields are a multivalued list, splunk only brings back the first value. try adding &lt;CODE&gt;|nomv C_4&lt;/CODE&gt; at the end of your subsearch to convert it to a single value. you can also try having &lt;CODE&gt;|mvcombine delim="," C_4&lt;/CODE&gt; before the &lt;CODE&gt;nomv&lt;/CODE&gt; to add a comma between the values. &lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.1/SearchReference/Mvcombine"&gt;http://docs.splunk.com/Documentation/Splunk/7.0.1/SearchReference/Mvcombine&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.1/SearchReference/Nomv"&gt;http://docs.splunk.com/Documentation/Splunk/7.0.1/SearchReference/Nomv&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2018 14:07:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Result-of-subsearch-field-repeated-instead-of-displaying-unique/m-p/310737#M163531</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2018-01-18T14:07:52Z</dc:date>
    </item>
  </channel>
</rss>

