<?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: Why does stats count(eval always returns zero when partial non-existant values exist? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-does-stats-count-eval-always-returns-zero-when-partial-non/m-p/623064#M216609</link>
    <description>&lt;P&gt;That did it! Thank you. I thought I tried that before but guess not.&lt;/P&gt;</description>
    <pubDate>Fri, 02 Dec 2022 19:59:51 GMT</pubDate>
    <dc:creator>ChadW</dc:creator>
    <dc:date>2022-12-02T19:59:51Z</dc:date>
    <item>
      <title>Why does stats count(eval always returns zero when partial non-existant values exist?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-stats-count-eval-always-returns-zero-when-partial-non/m-p/623044#M216602</link>
      <description>&lt;P&gt;My query:&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;index=primary eventType=ConnectionTest msg="network check results" | spath output=connectError details.error.connectionError | fillnull value=false connectError | dedup visitId | stats count as total, count(eval(connectError==true)) as errors&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;If I run this, "errors" always returns 0. However, if I run&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;index=primary eventType=ConnectionTest msg="network check results" | spath output=connectError details.error.connectionError | fillnull value=false connectError | dedup visitId | stats count by connectError&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;connectError properly returns the set of values in each bucket of connectError.&lt;/P&gt;
&lt;P&gt;My dataset will sometimes contain the object "details.error". I tried fillnull to resolve this but that didn't work.&lt;/P&gt;
&lt;P&gt;If I look at the Events data for the first or second query, I do see "connectError" in the "Interesting Fields" list on the left hand side.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":question_mark:"&gt;❓&lt;/span&gt;How do I get the first query to work whereby I can get errors and total errors? I want to follow it up with |eval percentErrors=errors/total but I first need to get the stats to work properly.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 16:09:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-stats-count-eval-always-returns-zero-when-partial-non/m-p/623044#M216602</guid>
      <dc:creator>ChadW</dc:creator>
      <dc:date>2022-12-02T16:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: Why does stats count(eval always returns zero when partial non-existant values exist?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-stats-count-eval-always-returns-zero-when-partial-non/m-p/623051#M216604</link>
      <description>&lt;P&gt;The count eval is comparing to a non-existent field called 'true' not to the string "true" so it never matches, hence the count of zero - try it this way&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=primary eventType=ConnectionTest msg="network check results" | spath output=connectError details.error.connectionError | fillnull value="false" connectError | dedup visitId | stats count as total, count(eval(connectError=="true")) as errors&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 02 Dec 2022 16:53:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-stats-count-eval-always-returns-zero-when-partial-non/m-p/623051#M216604</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-12-02T16:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: Why does stats count(eval always returns zero when partial non-existant values exist?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-stats-count-eval-always-returns-zero-when-partial-non/m-p/623064#M216609</link>
      <description>&lt;P&gt;That did it! Thank you. I thought I tried that before but guess not.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 19:59:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-stats-count-eval-always-returns-zero-when-partial-non/m-p/623064#M216609</guid>
      <dc:creator>ChadW</dc:creator>
      <dc:date>2022-12-02T19:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: Why does stats count(eval always returns zero when partial non-existant values exist?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-stats-count-eval-always-returns-zero-when-partial-non/m-p/623065#M216610</link>
      <description>&lt;P&gt;One disparate question around something I never understood. Why do I need to create an spath for this to work? In other words, instead of&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;count(eval(connectError=="true"))&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;why can't I just do&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;count(eval(details.error.connectionError=="true"))&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 20:02:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-stats-count-eval-always-returns-zero-when-partial-non/m-p/623065#M216610</guid>
      <dc:creator>ChadW</dc:creator>
      <dc:date>2022-12-02T20:02:21Z</dc:date>
    </item>
  </channel>
</rss>

