<?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: sum(count) returning 0 events in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/sum-count-returning-0-events/m-p/741332#M240591</link>
    <description>&lt;P&gt;Hi Giuseppe. Thank you for your response.&lt;BR /&gt;&lt;BR /&gt;This is just with test data. When I deal with a real scenario, face the same issue but it I can't simply run "count".&lt;/P&gt;</description>
    <pubDate>Mon, 10 Mar 2025 15:12:14 GMT</pubDate>
    <dc:creator>pedropiin</dc:creator>
    <dc:date>2025-03-10T15:12:14Z</dc:date>
    <item>
      <title>sum(count) returning 0 events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sum-count-returning-0-events/m-p/741327#M240588</link>
      <description>&lt;P&gt;Hi everyone.&lt;BR /&gt;&lt;BR /&gt;I have a query that basically filters certain events and sums them by category. But I'm facing issues when dealing with stats sum.&lt;BR /&gt;&lt;BR /&gt;The query is of the form&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=main source=...
...
...
| stats count BY name, ticket
| stats sum(count) as numOfTickets by name&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using some test data, removing the last line gives me a table with only one row of the form:&lt;BR /&gt;" name&amp;nbsp; &amp;nbsp; | tickets&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| count "&lt;BR /&gt;" name1 | ticket_name1 | 1"&lt;BR /&gt;(considering the first line as the names of the fields).&lt;BR /&gt;Whenever I run the last line, that is, "stats sum(count)..." , it returns 0 events.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I've already tried to, for example, redundantly check that count is a numeric value by doing "eval count = tonumber(count)".&lt;BR /&gt;&lt;BR /&gt;Why is this happening?&lt;BR /&gt;&lt;BR /&gt;Thank you in advance&lt;/P&gt;</description>
      <pubDate>Mon, 10 Mar 2025 14:56:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sum-count-returning-0-events/m-p/741327#M240588</guid>
      <dc:creator>pedropiin</dc:creator>
      <dc:date>2025-03-10T14:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: sum(count) returning 0 events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sum-count-returning-0-events/m-p/741328#M240589</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/276496"&gt;@pedropiin&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;this search hasn't sense, you could run:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=main source=...
...
...
| stats count BY name&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 10 Mar 2025 15:00:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sum-count-returning-0-events/m-p/741328#M240589</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2025-03-10T15:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: sum(count) returning 0 events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sum-count-returning-0-events/m-p/741332#M240591</link>
      <description>&lt;P&gt;Hi Giuseppe. Thank you for your response.&lt;BR /&gt;&lt;BR /&gt;This is just with test data. When I deal with a real scenario, face the same issue but it I can't simply run "count".&lt;/P&gt;</description>
      <pubDate>Mon, 10 Mar 2025 15:12:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sum-count-returning-0-events/m-p/741332#M240591</guid>
      <dc:creator>pedropiin</dc:creator>
      <dc:date>2025-03-10T15:12:14Z</dc:date>
    </item>
    <item>
      <title>Re: sum(count) returning 0 events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sum-count-returning-0-events/m-p/741338#M240594</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/276496"&gt;@pedropiin&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;there isn't any reason for your behavior: after a stats command you have only the fields present in the command.&lt;/P&gt;&lt;P&gt;Could you share the full search?&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 10 Mar 2025 16:01:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sum-count-returning-0-events/m-p/741338#M240594</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2025-03-10T16:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: sum(count) returning 0 events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sum-count-returning-0-events/m-p/741344#M240596</link>
      <description>&lt;P&gt;Your sample test data shows a field called "tickets" when your stats command is using a field called "ticket" - is it simply a typo in your example, or in your actual search?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Mar 2025 17:13:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sum-count-returning-0-events/m-p/741344#M240596</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2025-03-10T17:13:32Z</dc:date>
    </item>
  </channel>
</rss>

