<?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 Why are Total events not matching with breakdown searches? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Why-are-Total-events-not-matching-with-breakdown-searches/m-p/653599#M110855</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I'm creating a visualization and attempting to show the total amount of events, and break them down by a specific field.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So my initial search would be something like the search below, where I just count all the events for a specific sourcetype.&lt;/P&gt;
&lt;P&gt;index=foo sourcetype=bar | stats count as "Total Events for Security Control"&lt;/P&gt;
&lt;P&gt;The other searches would filter these by evaluating a third field and counting the ones that are true for the condition and the ones that are not.&lt;/P&gt;
&lt;P&gt;index=foo sourcetype=bar baz="Blocked" | stats count as "Total Blocked"&lt;/P&gt;
&lt;P&gt;index=foo sourcetype=bar baz!="Blocked" | stats count as "Total Blocked"&lt;/P&gt;
&lt;P&gt;The issue that I'm seeing is that for one of my sourcetype, the total number of events is not equal to the sum of the breakdown searches. Any idea as to why this might be happening?&lt;/P&gt;</description>
    <pubDate>Tue, 08 Aug 2023 18:52:16 GMT</pubDate>
    <dc:creator>hperez</dc:creator>
    <dc:date>2023-08-08T18:52:16Z</dc:date>
    <item>
      <title>Why are Total events not matching with breakdown searches?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-are-Total-events-not-matching-with-breakdown-searches/m-p/653599#M110855</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I'm creating a visualization and attempting to show the total amount of events, and break them down by a specific field.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So my initial search would be something like the search below, where I just count all the events for a specific sourcetype.&lt;/P&gt;
&lt;P&gt;index=foo sourcetype=bar | stats count as "Total Events for Security Control"&lt;/P&gt;
&lt;P&gt;The other searches would filter these by evaluating a third field and counting the ones that are true for the condition and the ones that are not.&lt;/P&gt;
&lt;P&gt;index=foo sourcetype=bar baz="Blocked" | stats count as "Total Blocked"&lt;/P&gt;
&lt;P&gt;index=foo sourcetype=bar baz!="Blocked" | stats count as "Total Blocked"&lt;/P&gt;
&lt;P&gt;The issue that I'm seeing is that for one of my sourcetype, the total number of events is not equal to the sum of the breakdown searches. Any idea as to why this might be happening?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2023 18:52:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-are-Total-events-not-matching-with-breakdown-searches/m-p/653599#M110855</guid>
      <dc:creator>hperez</dc:creator>
      <dc:date>2023-08-08T18:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: Why are Total events not matching with breakdown searches?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-are-Total-events-not-matching-with-breakdown-searches/m-p/653614#M110859</link>
      <description>&lt;P&gt;If any event is missing the "baz" field then it will not be counted in either breakdown search so the sum of the breakdown counts will not match the Total count.&amp;nbsp; Use this search to allow for when baz is null.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=foo sourcetype=bar NOT baz="Blocked" 
| stats count as "Total Not Blocked"&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 08 Aug 2023 19:44:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-are-Total-events-not-matching-with-breakdown-searches/m-p/653614#M110859</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-08-08T19:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: Why are Total events not matching with breakdown searches?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-are-Total-events-not-matching-with-breakdown-searches/m-p/653649#M110865</link>
      <description>&lt;P&gt;What&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;says, but as an additional point, it sounds like this may be a candidate for using a base search in the dashboard, which will help improve your dashboard speed.&lt;/P&gt;&lt;P&gt;If you're not familiar with base searches, see here for 'Post Process searches' &lt;A href="https://docs.splunk.com/Documentation/Splunk/9.1.0/Viz/Savedsearches" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/9.1.0/Viz/Savedsearches&lt;/A&gt;&lt;/P&gt;&lt;P&gt;In your XML you might have something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;search id="base"&amp;gt;
  &amp;lt;query&amp;gt;
index=foo sourcetype=bar
| stats count by baz
  &amp;lt;/query&amp;gt;
&amp;lt;/search&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;then for the post process searches you could do these 3 searches, one for each of the visualisations you want&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;search base="base"&amp;gt;
  &amp;lt;query&amp;gt;
| stats sum(count) as Total
  &amp;lt;/query&amp;gt;
&amp;lt;/search&amp;gt;

&amp;lt;search base="base"&amp;gt;
  &amp;lt;query&amp;gt;
| where baz="Blocked"
| stats sum(count) as Blocked
  &amp;lt;/query&amp;gt;
&amp;lt;/search&amp;gt;

&amp;lt;search base="base"&amp;gt;
  &amp;lt;query&amp;gt;
| where baz!="Blocked"
| stats sum(count) as Not_Blocked
  &amp;lt;/query&amp;gt;
&amp;lt;/search&amp;gt;
&lt;/LI-CODE&gt;&lt;P&gt;Hope this is useful&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2023 01:33:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-are-Total-events-not-matching-with-breakdown-searches/m-p/653649#M110865</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-08-09T01:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: Why are Total events not matching with breakdown searches?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-are-Total-events-not-matching-with-breakdown-searches/m-p/653728#M110869</link>
      <description>&lt;P&gt;I wasn't aware of this capability. Thank you. I'll take a look and see if I can implement it.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2023 13:56:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-are-Total-events-not-matching-with-breakdown-searches/m-p/653728#M110869</guid>
      <dc:creator>hperez</dc:creator>
      <dc:date>2023-08-09T13:56:16Z</dc:date>
    </item>
  </channel>
</rss>

