<?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: mvcount and stats count give different results in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/mvcount-and-stats-count-give-different-results/m-p/311475#M93340</link>
    <description>&lt;P&gt;hey &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;list(X)
Returns a list of up to 100 values of the field X as a multivalue entry. The order of the values reflects the order of input events.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;have a look in this official doc &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.1/SearchReference/Multivaluefunctions#list.28X.29"&gt;http://docs.splunk.com/Documentation/Splunk/7.0.1/SearchReference/Multivaluefunctions#list.28X.29&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;so your first query output is correct while your second query  results in largest clusterSizes of exactly 100 because of its limit (gives wrong output) and that is why there is a mismatch.&lt;/P&gt;

&lt;P&gt;let me know if this helps !&lt;/P&gt;</description>
    <pubDate>Thu, 18 Jan 2018 18:58:07 GMT</pubDate>
    <dc:creator>mayurr98</dc:creator>
    <dc:date>2018-01-18T18:58:07Z</dc:date>
    <item>
      <title>mvcount and stats count give different results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/mvcount-and-stats-count-give-different-results/m-p/311474#M93339</link>
      <description>&lt;P&gt;I have a log file where each line has an &lt;CODE&gt;itemId&lt;/CODE&gt; and a &lt;CODE&gt;clusterId&lt;/CODE&gt;.&lt;BR /&gt;
When I run the following sort of queries &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats count(itemId) as clusterSize by clusterId 
| sort - clusterSize
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;vs&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats list(itemId) AS items BY clusterId 
| eval clusterSize=mvcount(items) 
| sort -clusterSize
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and get different results. I don't know if it's a coincidence but the second command results in largest clusterSizes of exactly 100. &lt;/P&gt;

&lt;P&gt;Does anybody have an idea?&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2018 18:41:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/mvcount-and-stats-count-give-different-results/m-p/311474#M93339</guid>
      <dc:creator>viggor</dc:creator>
      <dc:date>2018-01-18T18:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: mvcount and stats count give different results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/mvcount-and-stats-count-give-different-results/m-p/311475#M93340</link>
      <description>&lt;P&gt;hey &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;list(X)
Returns a list of up to 100 values of the field X as a multivalue entry. The order of the values reflects the order of input events.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;have a look in this official doc &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.1/SearchReference/Multivaluefunctions#list.28X.29"&gt;http://docs.splunk.com/Documentation/Splunk/7.0.1/SearchReference/Multivaluefunctions#list.28X.29&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;so your first query output is correct while your second query  results in largest clusterSizes of exactly 100 because of its limit (gives wrong output) and that is why there is a mismatch.&lt;/P&gt;

&lt;P&gt;let me know if this helps !&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2018 18:58:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/mvcount-and-stats-count-give-different-results/m-p/311475#M93340</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-01-18T18:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: mvcount and stats count give different results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/mvcount-and-stats-count-give-different-results/m-p/311476#M93341</link>
      <description>&lt;P&gt;Per the Splunk &lt;A href="http://docs.splunk.com/Documentation/SplunkCloud/6.6.3/SearchReference/CommonStatsFunctions#Supported_functions_and_syntax"&gt;documentation&lt;/A&gt;, &lt;CODE&gt;list()&lt;/CODE&gt; Returns a list of up to 100 values of the field X as a multivalue entry.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2018 18:59:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/mvcount-and-stats-count-give-different-results/m-p/311476#M93341</guid>
      <dc:creator>mporath_splunk</dc:creator>
      <dc:date>2018-01-18T18:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: mvcount and stats count give different results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/mvcount-and-stats-count-give-different-results/m-p/311477#M93342</link>
      <description>&lt;P&gt;the list command only returns 100 field values. if there are more than 100 values of itemId, this is why there is that problem in the second query. &lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/SplunkCloud/6.6.3/SearchReference/CommonStatsFunctions#Supported_functions_and_syntax"&gt;http://docs.splunk.com/Documentation/SplunkCloud/6.6.3/SearchReference/CommonStatsFunctions#Supported_functions_and_syntax&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;if you're looking for a total count of itemIds by clusterId, the first query works great, if you want to know how many unique itemIds are in each clusterId, try &lt;CODE&gt;|stats dc(itemId) as clusterSize by clusterId&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2018 19:01:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/mvcount-and-stats-count-give-different-results/m-p/311477#M93342</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2018-01-18T19:01:36Z</dc:date>
    </item>
  </channel>
</rss>

