<?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: count(failure) is returning 0 always in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/count-failure-is-returning-0-always/m-p/59030#M14545</link>
    <description>&lt;P&gt;This will avoid the problem of case-sensitivity:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;yourbasesearch&amp;gt;  eventtype="failure" | stats count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And it is probably more efficient. You should try to eliminate as many events as possible in the initial search.&lt;/P&gt;

&lt;P&gt;BTW, &lt;CODE&gt;search&lt;/CODE&gt; is case-insensitive for values, and that includes field values. But the &lt;CODE&gt;stats&lt;/CODE&gt; command and the &lt;CODE&gt;eval&lt;/CODE&gt; function are case-sensitive.&lt;/P&gt;</description>
    <pubDate>Tue, 12 Mar 2013 18:28:43 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2013-03-12T18:28:43Z</dc:date>
    <item>
      <title>count(failure) is returning 0 always</title>
      <link>https://community.splunk.com/t5/Splunk-Search/count-failure-is-returning-0-always/m-p/59025#M14540</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am trying to find the count of total failure to calculate the failure percentage.&lt;/P&gt;

&lt;P&gt;&lt;YOURBASESEARCH&gt; | stats count(eval(eventtype="failure")) AS Failed&lt;/YOURBASESEARCH&gt;&lt;/P&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;P&gt;&lt;YOURBASESEARCH&gt; | stats count("failure") AS Failed&lt;/YOURBASESEARCH&gt;&lt;/P&gt;

&lt;P&gt;In both the cases its always returning 0, whereas I have failure status count is 300 in my logs.&lt;/P&gt;

&lt;P&gt;Please help me out in resolving this.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2013 17:32:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/count-failure-is-returning-0-always/m-p/59025#M14540</guid>
      <dc:creator>Jiten009</dc:creator>
      <dc:date>2013-03-12T17:32:21Z</dc:date>
    </item>
    <item>
      <title>Re: count(failure) is returning 0 always</title>
      <link>https://community.splunk.com/t5/Splunk-Search/count-failure-is-returning-0-always/m-p/59026#M14541</link>
      <description>&lt;P&gt;The first stats is correct, provided you have a field named eventtype that occasionally has the value "failure".&lt;/P&gt;

&lt;P&gt;As a different approach, try top eventtype instead of stats count.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2013 17:43:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/count-failure-is-returning-0-always/m-p/59026#M14541</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-03-12T17:43:18Z</dc:date>
    </item>
    <item>
      <title>Re: count(failure) is returning 0 always</title>
      <link>https://community.splunk.com/t5/Splunk-Search/count-failure-is-returning-0-always/m-p/59027#M14542</link>
      <description>&lt;P&gt;yes, I have  a field in my log with name eventtype which has value failure i.e host=168.94.64.138,eventtype=Failure,facetFieldPrefix="1&lt;/P&gt;

&lt;P&gt;Thanks for your reply.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2013 17:46:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/count-failure-is-returning-0-always/m-p/59027#M14542</guid>
      <dc:creator>Jiten009</dc:creator>
      <dc:date>2013-03-12T17:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: count(failure) is returning 0 always</title>
      <link>https://community.splunk.com/t5/Splunk-Search/count-failure-is-returning-0-always/m-p/59028#M14543</link>
      <description>&lt;P&gt;ya, got it the keyword 'Failure' in search is case sensitive.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2013 17:48:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/count-failure-is-returning-0-always/m-p/59028#M14543</guid>
      <dc:creator>Jiten009</dc:creator>
      <dc:date>2013-03-12T17:48:48Z</dc:date>
    </item>
    <item>
      <title>Re: count(failure) is returning 0 always</title>
      <link>https://community.splunk.com/t5/Splunk-Search/count-failure-is-returning-0-always/m-p/59029#M14544</link>
      <description>&lt;P&gt;Was just about to post that &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2013 17:49:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/count-failure-is-returning-0-always/m-p/59029#M14544</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-03-12T17:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: count(failure) is returning 0 always</title>
      <link>https://community.splunk.com/t5/Splunk-Search/count-failure-is-returning-0-always/m-p/59030#M14545</link>
      <description>&lt;P&gt;This will avoid the problem of case-sensitivity:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;yourbasesearch&amp;gt;  eventtype="failure" | stats count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And it is probably more efficient. You should try to eliminate as many events as possible in the initial search.&lt;/P&gt;

&lt;P&gt;BTW, &lt;CODE&gt;search&lt;/CODE&gt; is case-insensitive for values, and that includes field values. But the &lt;CODE&gt;stats&lt;/CODE&gt; command and the &lt;CODE&gt;eval&lt;/CODE&gt; function are case-sensitive.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2013 18:28:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/count-failure-is-returning-0-always/m-p/59030#M14545</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-03-12T18:28:43Z</dc:date>
    </item>
  </channel>
</rss>

