<?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: Discrepany in total count in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Discrepany-in-total-count/m-p/426745#M122259</link>
    <description>&lt;P&gt;@woodcock hello!! thank you! this work as well!! &lt;/P&gt;</description>
    <pubDate>Mon, 05 Aug 2019 03:50:19 GMT</pubDate>
    <dc:creator>chinkeeparco</dc:creator>
    <dc:date>2019-08-05T03:50:19Z</dc:date>
    <item>
      <title>Discrepany in total count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Discrepany-in-total-count/m-p/426735#M122249</link>
      <description>&lt;P&gt;Hello guys,&lt;/P&gt;

&lt;P&gt;I have the following syntax and data:&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/273355-test1.jpg" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;However, there is a discrepancy with the total count per category.&lt;/P&gt;

&lt;P&gt;For example, &lt;BR /&gt;
Password Reset should be 3106 (when I manually count it) but in the screenshot provided as you can see, the total count only has 3007 &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; am i missing something?&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/273356-test2.jpg" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;in the second screenshot, as you can see, it displays the correct count; however, it has duplicated value which I don't know how to resolve.&lt;/P&gt;

&lt;P&gt;Sample data:&lt;/P&gt;

&lt;P&gt;short_description,                              category,                    cluster_count&lt;BR /&gt;&lt;BR /&gt;
need help password reset,            Password reset ,            50&lt;BR /&gt;
Internet access,                               Connection issue,         10&lt;BR /&gt;
XXXX Installation,                              Installation request,     60&lt;BR /&gt;
Reset my password,                         Password reset ,            55&lt;/P&gt;

&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:35:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Discrepany-in-total-count/m-p/426735#M122249</guid>
      <dc:creator>chinkeeparco</dc:creator>
      <dc:date>2020-09-30T01:35:43Z</dc:date>
    </item>
    <item>
      <title>Re: Discrepany in total count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Discrepany-in-total-count/m-p/426736#M122250</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/194030"&gt;@chinkeeparco&lt;/a&gt;,&lt;BR /&gt;
What's the significance of cluster_count here? If cluster_count is not required in your final result , just use &lt;CODE&gt;stats count by category|eventstats sum(count) as Total&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:35:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Discrepany-in-total-count/m-p/426736#M122250</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2020-09-30T01:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: Discrepany in total count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Discrepany-in-total-count/m-p/426737#M122251</link>
      <description>&lt;P&gt;can you provide an example of the original csv?&lt;/P&gt;</description>
      <pubDate>Sat, 03 Aug 2019 14:25:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Discrepany-in-total-count/m-p/426737#M122251</guid>
      <dc:creator>diogofgm</dc:creator>
      <dc:date>2019-08-03T14:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: Discrepany in total count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Discrepany-in-total-count/m-p/426738#M122252</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/194030"&gt;@chinkeeparco&lt;/a&gt; as per your query you have multiple rows in your csv file for the same combination of category and cluster_count. Which means for the first query duplicates are not being considered because you have performed &lt;CODE&gt;stats count by category, cluster_count&lt;/CODE&gt; in the first query and used the same for subsequent query.&lt;/P&gt;

&lt;P&gt;In your second query you are removing duplicates by &lt;CODE&gt;stats count by category, cluster_count&lt;/CODE&gt; but then you get the duplicate count back using &lt;CODE&gt;cluster_count*count&lt;/CODE&gt; as total.&lt;/P&gt;

&lt;P&gt;In essence yes there will be discrepancy in your query but which one is correct depends on your use case. If you need duplicate count remove &lt;CODE&gt;stats count by category, cluster_count&lt;/CODE&gt;. If you dont need duplicates then your query is showing the correct results.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:38:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Discrepany-in-total-count/m-p/426738#M122252</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-09-30T01:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: Discrepany in total count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Discrepany-in-total-count/m-p/426739#M122253</link>
      <description>&lt;P&gt;@diogofgm hello, I edit the orginal post and added the sample data &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Aug 2019 04:36:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Discrepany-in-total-count/m-p/426739#M122253</guid>
      <dc:creator>chinkeeparco</dc:creator>
      <dc:date>2019-08-04T04:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: Discrepany in total count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Discrepany-in-total-count/m-p/426740#M122254</link>
      <description>&lt;P&gt;@renjith.nair hello! thank you for your answer. However, i need the cluster_count. I edited the original post for the sample data &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Aug 2019 04:38:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Discrepany-in-total-count/m-p/426740#M122254</guid>
      <dc:creator>chinkeeparco</dc:creator>
      <dc:date>2019-08-04T04:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: Discrepany in total count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Discrepany-in-total-count/m-p/426741#M122255</link>
      <description>&lt;P&gt;@niketnilay thank you so much for that!! It resolved my issue!  I don't know how I can thank you enough.&lt;/P&gt;</description>
      <pubDate>Sun, 04 Aug 2019 04:41:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Discrepany-in-total-count/m-p/426741#M122255</guid>
      <dc:creator>chinkeeparco</dc:creator>
      <dc:date>2019-08-04T04:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: Discrepany in total count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Discrepany-in-total-count/m-p/426742#M122256</link>
      <description>&lt;P&gt;@chinkeeparco I am glad the explanation worked for you to get the issue resolved. I have converted my comment to answer. Please accept the answers to mark this question as answered.&lt;/P&gt;

&lt;P&gt;Well do think about Splunk Answers community when you run into issues. As far as thanking is concerned do actively participate on Splunk Answers and help others facing issues you have already resolved.&lt;/P&gt;

&lt;P&gt;Happy Splunking!&lt;/P&gt;</description>
      <pubDate>Sun, 04 Aug 2019 06:33:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Discrepany-in-total-count/m-p/426742#M122256</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2019-08-04T06:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: Discrepany in total count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Discrepany-in-total-count/m-p/426743#M122257</link>
      <description>&lt;P&gt;I suspect that when the &lt;CODE&gt;cluster_count&lt;/CODE&gt; value is &lt;CODE&gt;1&lt;/CODE&gt; then there is no value for &lt;CODE&gt;cluster_count&lt;/CODE&gt; (so the &lt;CODE&gt;1&lt;/CODE&gt; is implied).  If so, then the correct answer should be given by this search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=&amp;lt;You should always specify an index&amp;gt; AND source="sap_cluster.csv"
| eval cluster_count = coalesce(cluster_count, 1)
| rename COMMENT AS "At this point, both of your solutions should give the same answer"
| stats sum(cluster_count) AS Total BY category
| eventstats sum(Count) AS Total
| eval perc = round((Count / Total) * 100)
| sort 0 - Count
| table category Count perc
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Aug 2019 01:41:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Discrepany-in-total-count/m-p/426743#M122257</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-08-05T01:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: Discrepany in total count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Discrepany-in-total-count/m-p/426744#M122258</link>
      <description>&lt;P&gt;I will! thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2019 03:46:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Discrepany-in-total-count/m-p/426744#M122258</guid>
      <dc:creator>chinkeeparco</dc:creator>
      <dc:date>2019-08-05T03:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: Discrepany in total count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Discrepany-in-total-count/m-p/426745#M122259</link>
      <description>&lt;P&gt;@woodcock hello!! thank you! this work as well!! &lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2019 03:50:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Discrepany-in-total-count/m-p/426745#M122259</guid>
      <dc:creator>chinkeeparco</dc:creator>
      <dc:date>2019-08-05T03:50:19Z</dc:date>
    </item>
  </channel>
</rss>

