<?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: Total and Error count by Provider in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Total-and-Error-count-by-Provider/m-p/521739#M147032</link>
    <description>&lt;P&gt;Tried with single quotes, unfortunately, getting the same results.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 09:05:52 GMT</pubDate>
    <dc:creator>rajkskumar</dc:creator>
    <dc:date>2020-09-28T09:05:52Z</dc:date>
    <item>
      <title>Total and Error count by Provider</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Total-and-Error-count-by-Provider/m-p/521725#M147026</link>
      <description>&lt;P&gt;I am trying to create a table which has Total number of events and the Error count in the events. The field 'services.errorCode' will be filled if there is an error, it will not be filled if the event is a success.&lt;/P&gt;&lt;P&gt;The below query gives me the correct count of Total, but the Error Count is always 0. I have verified in the Events and there are many events with the field errorCode filled.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=prod | stats count as "Total", count(eval("services.errorCode"!=null)) as "Error Count" by services.serviceProviderName&lt;/LI-CODE&gt;&lt;P&gt;Please guide me on how this could be done.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 08:52:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Total-and-Error-count-by-Provider/m-p/521725#M147026</guid>
      <dc:creator>rajkskumar</dc:creator>
      <dc:date>2020-09-28T08:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: Total and Error count by Provider</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Total-and-Error-count-by-Provider/m-p/521734#M147031</link>
      <description>&lt;P&gt;Try single quotes around the field name&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=prod | stats count as "Total", count(eval('services.errorCode'!=null)) as "Error Count" by services.serviceProviderName&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 28 Sep 2020 08:58:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Total-and-Error-count-by-Provider/m-p/521734#M147031</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-09-28T08:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: Total and Error count by Provider</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Total-and-Error-count-by-Provider/m-p/521739#M147032</link>
      <description>&lt;P&gt;Tried with single quotes, unfortunately, getting the same results.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:05:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Total-and-Error-count-by-Provider/m-p/521739#M147032</guid>
      <dc:creator>rajkskumar</dc:creator>
      <dc:date>2020-09-28T09:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: Total and Error count by Provider</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Total-and-Error-count-by-Provider/m-p/521742#M147033</link>
      <description>&lt;P&gt;Other people have reported problems with eval within counts so you could try&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=prod 
| eval error=if(isnull(services.errorCode),0,1)
| stats count as "Total", sum(error) as "Error Count" by services.serviceProviderName&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:12:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Total-and-Error-count-by-Provider/m-p/521742#M147033</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-09-28T09:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: Total and Error count by Provider</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Total-and-Error-count-by-Provider/m-p/521767#M147046</link>
      <description>&lt;P&gt;It was not working. I have put the field name within Double quotes. Now, everything gets counted as error.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=prod 
| eval error=if(isnull("services.errorCode"),0,1)
| stats count as "Total", sum(error) as "Error Count" by services.serviceProviderName&lt;/LI-CODE&gt;&lt;P&gt;Instead of isnull, I also tried with checking the length, if it is zero.&amp;nbsp; That is not working as well. Total Event count and Error count is coming out the same.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:44:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Total-and-Error-count-by-Provider/m-p/521767#M147046</guid>
      <dc:creator>rajkskumar</dc:creator>
      <dc:date>2020-09-28T11:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: Total and Error count by Provider</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Total-and-Error-count-by-Provider/m-p/521768#M147047</link>
      <description>&lt;P&gt;Putting the fieldname in double quotes just converts it to a string with the name of the field in. Try using single quotes as I suggested earlier&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=prod 
| eval error=if(isnull('services.errorCode'),0,1)
| stats count as "Total", sum(error) as "Error Count" by services.serviceProviderName&lt;/LI-CODE&gt;&lt;P&gt;Single quotes are often needed for field names with dots in.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:48:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Total-and-Error-count-by-Provider/m-p/521768#M147047</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-09-28T11:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: Total and Error count by Provider</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Total-and-Error-count-by-Provider/m-p/521771#M147049</link>
      <description>&lt;P&gt;Could you please suggest to me how to add the percentage of Errors against Total events?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=ladedienst-prod 
| eval errorCount=if(isnull('services.errorCode'),0,1)
| stats count as "Total", sum(errorCount) as "Error Count" by services.serviceProviderName&lt;/LI-CODE&gt;&lt;P&gt;I have tried with eval before the stats command. But, it was not working.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:14:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Total-and-Error-count-by-Provider/m-p/521771#M147049</guid>
      <dc:creator>rajkskumar</dc:creator>
      <dc:date>2020-09-28T12:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: Total and Error count by Provider</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Total-and-Error-count-by-Provider/m-p/521772#M147050</link>
      <description>&lt;LI-CODE lang="markup"&gt;index=ladedienst-prod 
| eval errorCount=if(isnull('services.errorCode'),0,1)
| stats count as "Total", sum(errorCount) as "Error Count" by services.serviceProviderName
| eval percent=round(('Error Count' * 100) / Total,2)&lt;/LI-CODE&gt;&lt;P&gt;The calculation should be done after the stats command&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:23:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Total-and-Error-count-by-Provider/m-p/521772#M147050</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-09-28T12:23:41Z</dc:date>
    </item>
  </channel>
</rss>

