<?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: Display a result when the count =0 in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Display-a-result-when-the-count-0/m-p/145376#M40514</link>
    <description>&lt;P&gt;Thank you for your response, it didn't give me the rigth result because I had a mistake in my source ., It was my fault. &lt;BR /&gt;
Now it works perfectly thank you &lt;STRONG&gt;sideview&lt;/STRONG&gt; have a nice day&lt;/P&gt;</description>
    <pubDate>Mon, 20 Apr 2015 07:46:53 GMT</pubDate>
    <dc:creator>otman01</dc:creator>
    <dc:date>2015-04-20T07:46:53Z</dc:date>
    <item>
      <title>Display a result when the count =0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-a-result-when-the-count-0/m-p/145366#M40504</link>
      <description>&lt;P&gt;Hi every one,&lt;BR /&gt;
Whene I use the command count with Stats or chart, the result display just the events when count is greater than 0.&lt;BR /&gt;
In my case I want to display 0 if the count = 0.&lt;BR /&gt;
It is possible ? &lt;BR /&gt;
Thank you for your help have a nice day &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2015 08:20:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-a-result-when-the-count-0/m-p/145366#M40504</guid>
      <dc:creator>otman01</dc:creator>
      <dc:date>2015-04-16T08:20:14Z</dc:date>
    </item>
    <item>
      <title>Re: Display a result when the count =0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-a-result-when-the-count-0/m-p/145367#M40505</link>
      <description>&lt;P&gt;Hi.. stats will always show the count. if there are no events the result will show count as 0. &lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2015 08:31:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-a-result-when-the-count-0/m-p/145367#M40505</guid>
      <dc:creator>srinathd</dc:creator>
      <dc:date>2015-04-16T08:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: Display a result when the count =0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-a-result-when-the-count-0/m-p/145368#M40506</link>
      <description>&lt;P&gt;Take a look at this answer &lt;A href="http://answers.splunk.com/answers/176466/how-to-use-eval-if-there-is-no-result-from-the-bas-1.html"&gt;http://answers.splunk.com/answers/176466/how-to-use-eval-if-there-is-no-result-from-the-bas-1.html&lt;/A&gt; to get some more details about using &lt;CODE&gt;stats count&lt;/CODE&gt; in such a use case.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2015 08:39:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-a-result-when-the-count-0/m-p/145368#M40506</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-04-16T08:39:26Z</dc:date>
    </item>
    <item>
      <title>Re: Display a result when the count =0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-a-result-when-the-count-0/m-p/145369#M40507</link>
      <description>&lt;UL&gt;
&lt;LI&gt;this is my search query 
source="WinEventLog:*"   | stats count by EventType&lt;/LI&gt;
&lt;LI&gt;this is the resul of the search
EventType count
0   --------------21
2   --------------11
3   ---------------1
4   --------------22
What I want is to display 2 other envents that are not listed in the result 
EventType1 and EventType5&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2015 09:18:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-a-result-when-the-count-0/m-p/145369#M40507</guid>
      <dc:creator>otman01</dc:creator>
      <dc:date>2015-04-16T09:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: Display a result when the count =0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-a-result-when-the-count-0/m-p/145370#M40508</link>
      <description>&lt;P&gt;Based on your comment,  you need the output to show certain values for EventType even if there is no rawdata with that value. &lt;/P&gt;

&lt;P&gt;The answer is a little weird.   Here's your search with the real results from teh raw data. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="WinEventLog:" | stats count by EventType
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;now if we tack on an extra append command, and then an extra stats command,  we can fabricate some rows that have zeros as the count, but in which all EventTypes are reflected. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| append [| stats count | eval EventType=split("1,2,3,4,5",",") | mvexpand EventType] | stats sum(count) as count by EventType
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now all 5 EventTypes will be in the results regardless of their presence in the raw data. &lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2015 15:51:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-a-result-when-the-count-0/m-p/145370#M40508</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2015-04-16T15:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: Display a result when the count =0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-a-result-when-the-count-0/m-p/145371#M40509</link>
      <description>&lt;P&gt;Cool question. I can answer if you can fill in a couple blanks for me:&lt;BR /&gt;
What app are you using? (search?)&lt;BR /&gt;
Are the eventtypes shared or private? If shared, are they shared in app or globally?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2015 18:35:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-a-result-when-the-count-0/m-p/145371#M40509</guid>
      <dc:creator>masonmorales</dc:creator>
      <dc:date>2015-04-16T18:35:25Z</dc:date>
    </item>
    <item>
      <title>Re: Display a result when the count =0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-a-result-when-the-count-0/m-p/145372#M40510</link>
      <description>&lt;P&gt;Also is EventType a field you created or an actual "event type" knowledge object? (&lt;A href="http://docs.splunk.com/Splexicon:Eventtype"&gt;http://docs.splunk.com/Splexicon:Eventtype&lt;/A&gt;)&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2015 18:36:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-a-result-when-the-count-0/m-p/145372#M40510</guid>
      <dc:creator>masonmorales</dc:creator>
      <dc:date>2015-04-16T18:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: Display a result when the count =0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-a-result-when-the-count-0/m-p/145373#M40511</link>
      <description>&lt;P&gt;Thank you for your response. &lt;BR /&gt;
* so, EventType is a field we can say that is a GameCategory for example.&lt;BR /&gt;
* Yes,  I use searche app.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2015 07:40:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-a-result-when-the-count-0/m-p/145373#M40511</guid>
      <dc:creator>otman01</dc:creator>
      <dc:date>2015-04-17T07:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: Display a result when the count =0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-a-result-when-the-count-0/m-p/145374#M40512</link>
      <description>&lt;P&gt;thank you for your response but the result given by the request is wrong  &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2015 08:37:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-a-result-when-the-count-0/m-p/145374#M40512</guid>
      <dc:creator>otman01</dc:creator>
      <dc:date>2015-04-17T08:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: Display a result when the count =0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-a-result-when-the-count-0/m-p/145375#M40513</link>
      <description>&lt;P&gt;That is odd.   In case you read too fast and just pasted in the part starting with &lt;CODE&gt;append&lt;/CODE&gt;, the full query is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="WinEventLog:" | stats count by EventType | append [| stats count | eval EventType=split("1,2,3,4,5",",") | mvexpand EventType] | stats sum(count) as count by EventType
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;it will give you exactly what you are asking for.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2015 15:09:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-a-result-when-the-count-0/m-p/145375#M40513</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2015-04-17T15:09:24Z</dc:date>
    </item>
    <item>
      <title>Re: Display a result when the count =0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-a-result-when-the-count-0/m-p/145376#M40514</link>
      <description>&lt;P&gt;Thank you for your response, it didn't give me the rigth result because I had a mistake in my source ., It was my fault. &lt;BR /&gt;
Now it works perfectly thank you &lt;STRONG&gt;sideview&lt;/STRONG&gt; have a nice day&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2015 07:46:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-a-result-when-the-count-0/m-p/145376#M40514</guid>
      <dc:creator>otman01</dc:creator>
      <dc:date>2015-04-20T07:46:53Z</dc:date>
    </item>
  </channel>
</rss>

