<?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: Zero count not displaying when stats count is used in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Zero-count-not-displaying-when-stats-count-is-used/m-p/565620#M197077</link>
    <description>&lt;P&gt;Try&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="stage*" source="*record service*" 
| eval type=case(like(message, "%successful generated account%"),"Success Accounts",
like(message, "%Granting failed Accounts%"),"Granting failed Accounts", like(message, "%Inbound setup failed accounts%"),"Inbound  failed Accounts")
|stats count as Results by type
|append [|stats count as Results|eval type="Success Accounts,Granting failed Accounts,Inbound  failed Accounts"|makemv type delim=","|mvexpand type]
|stats sum(Results) by type&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Sep 2021 07:44:27 GMT</pubDate>
    <dc:creator>renjith_nair</dc:creator>
    <dc:date>2021-09-02T07:44:27Z</dc:date>
    <item>
      <title>Zero count not displaying when stats count is used</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Zero-count-not-displaying-when-stats-count-is-used/m-p/565596#M197065</link>
      <description>&lt;P&gt;My query is :&lt;/P&gt;&lt;P&gt;index="stage*" source="*record service*" | eval type=case(like(message, "%successful generated account%"),"Success Accounts",&lt;BR /&gt;like(message, "%Granting failed Accounts%"),"Granting failed Accounts", like(message, "%Inbound setup failed accounts%"),"Inbound&amp;nbsp; failed Accounts")|&lt;BR /&gt;stats count as Results by type&lt;/P&gt;&lt;P&gt;I am getting the result as:&lt;/P&gt;&lt;P&gt;type&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Results&lt;/P&gt;&lt;P&gt;Success Accounts&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10&lt;/P&gt;&lt;P&gt;Granting failed Accounts&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;20&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am unable to get the results for the string&amp;nbsp; Inbound failed Accounts as the results are zero. I need the output as&amp;nbsp;&lt;/P&gt;&lt;P&gt;type&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Results&lt;/P&gt;&lt;P&gt;Success Accounts&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10&lt;/P&gt;&lt;P&gt;Granting failed Accounts&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;20&lt;/P&gt;&lt;P&gt;Inbound&amp;nbsp; failed Accounts&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me with the query for displaying the strings with zero count as well&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Sep 2021 06:32:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Zero-count-not-displaying-when-stats-count-is-used/m-p/565596#M197065</guid>
      <dc:creator>Harshi1993</dc:creator>
      <dc:date>2021-09-02T06:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: Zero count not displaying when stats count is used</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Zero-count-not-displaying-when-stats-count-is-used/m-p/565614#M197072</link>
      <description>&lt;LI-CODE lang="markup"&gt;| append [| makeresults
| eval type=split"Success Accounts|Granting failed Accounts|Inbound  failed Accounts","|")
| mvexpand type
| eval Results=0
| table type Results]
| stats sum(Results) as Results by type&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 02 Sep 2021 07:36:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Zero-count-not-displaying-when-stats-count-is-used/m-p/565614#M197072</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-09-02T07:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: Zero count not displaying when stats count is used</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Zero-count-not-displaying-when-stats-count-is-used/m-p/565618#M197075</link>
      <description>&lt;P&gt;It's a typical mistake to want to have knowledge about _what_ was done earlier "down the road" whereas Splunk doesn't work that way.&lt;/P&gt;&lt;P&gt;After a pipe you get only a _result_ of the command from before the pipe. So if any command is supposed to look for - let's say - one of three different values but finds only two of them, the result will only have two of those values and any subsequent command won't have the knowledge that you wanted to search for the third value as well. You only get the results.&lt;/P&gt;&lt;P&gt;So the most obvious workaround in such case as yours is - as &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt; showed - creating an initial set of "empty" (with a value of zero) result set and then sum this set with your actual result. That way if you don't have any other results, you'll just stay with your static results of zero hits.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Sep 2021 07:44:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Zero-count-not-displaying-when-stats-count-is-used/m-p/565618#M197075</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-09-02T07:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: Zero count not displaying when stats count is used</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Zero-count-not-displaying-when-stats-count-is-used/m-p/565620#M197077</link>
      <description>&lt;P&gt;Try&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="stage*" source="*record service*" 
| eval type=case(like(message, "%successful generated account%"),"Success Accounts",
like(message, "%Granting failed Accounts%"),"Granting failed Accounts", like(message, "%Inbound setup failed accounts%"),"Inbound  failed Accounts")
|stats count as Results by type
|append [|stats count as Results|eval type="Success Accounts,Granting failed Accounts,Inbound  failed Accounts"|makemv type delim=","|mvexpand type]
|stats sum(Results) by type&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Sep 2021 07:44:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Zero-count-not-displaying-when-stats-count-is-used/m-p/565620#M197077</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2021-09-02T07:44:27Z</dc:date>
    </item>
  </channel>
</rss>

