<?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 Add count of field instead of just count it in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Add-count-of-field-instead-of-just-count-it/m-p/558667#M158716</link>
    <description>&lt;P&gt;Hi I have log file that each minute store 1 event like this&lt;/P&gt;&lt;P&gt;8:00 &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;8:01 &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;8:02 &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;instead of counting i want store last value and add new value to that, like this:&lt;/P&gt;&lt;P&gt;8:48 &amp;nbsp; &amp;nbsp;2&lt;/P&gt;&lt;P&gt;8:49 &amp;nbsp; 12 (10+2)&lt;/P&gt;&lt;P&gt;8:50 &amp;nbsp; 20 &amp;nbsp;(3+12)&lt;/P&gt;&lt;P&gt;8:51 &amp;nbsp; 21 (1+20)&lt;/P&gt;&lt;P&gt;…&lt;/P&gt;&lt;P&gt;any idea?&lt;/P&gt;&lt;P&gt;&amp;nbsp;Thanks&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Jul 2021 11:55:15 GMT</pubDate>
    <dc:creator>indeed_2000</dc:creator>
    <dc:date>2021-07-08T11:55:15Z</dc:date>
    <item>
      <title>Add count of field instead of just count it</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-count-of-field-instead-of-just-count-it/m-p/558667#M158716</link>
      <description>&lt;P&gt;Hi I have log file that each minute store 1 event like this&lt;/P&gt;&lt;P&gt;8:00 &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;8:01 &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;8:02 &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;instead of counting i want store last value and add new value to that, like this:&lt;/P&gt;&lt;P&gt;8:48 &amp;nbsp; &amp;nbsp;2&lt;/P&gt;&lt;P&gt;8:49 &amp;nbsp; 12 (10+2)&lt;/P&gt;&lt;P&gt;8:50 &amp;nbsp; 20 &amp;nbsp;(3+12)&lt;/P&gt;&lt;P&gt;8:51 &amp;nbsp; 21 (1+20)&lt;/P&gt;&lt;P&gt;…&lt;/P&gt;&lt;P&gt;any idea?&lt;/P&gt;&lt;P&gt;&amp;nbsp;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 11:55:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-count-of-field-instead-of-just-count-it/m-p/558667#M158716</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2021-07-08T11:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: Add count of field instead of just count it</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-count-of-field-instead-of-just-count-it/m-p/558671#M158719</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/217339"&gt;@indeed_2000&lt;/a&gt;&amp;nbsp; You have to use streamstats command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 12:13:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-count-of-field-instead-of-just-count-it/m-p/558671#M158719</guid>
      <dc:creator>venkatasri</dc:creator>
      <dc:date>2021-07-08T12:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: Add count of field instead of just count it</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-count-of-field-instead-of-just-count-it/m-p/558673#M158721</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/217339"&gt;@indeed_2000&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can try something like this, i assumed your field name for numerical as 'count' you have to change it for your case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search_goes_here&amp;gt;
| reverse 
| streamstats sum(count)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output would be something like this,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="venkatasri_0-1625746936442.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14984i4E4B3A0EEF59A994/image-size/medium?v=v2&amp;amp;px=400" role="button" title="venkatasri_0-1625746936442.png" alt="venkatasri_0-1625746936442.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;An upvote would be appreciated and Accept solution if this reply helps!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 12:23:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-count-of-field-instead-of-just-count-it/m-p/558673#M158721</guid>
      <dc:creator>venkatasri</dc:creator>
      <dc:date>2021-07-08T12:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: Add count of field instead of just count it</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-count-of-field-instead-of-just-count-it/m-p/558675#M158722</link>
      <description>&lt;LI-CODE lang="markup"&gt;| streamstats sum(count) as runningtotal&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 08 Jul 2021 12:22:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-count-of-field-instead-of-just-count-it/m-p/558675#M158722</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-07-08T12:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: Add count of field instead of just count it</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-count-of-field-instead-of-just-count-it/m-p/558690#M158732</link>
      <description>&lt;P&gt;Field value is not number&lt;/P&gt;&lt;P&gt;field name= status (success,fail)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also i try these but not work:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;index=main | reverse&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;| streamstats sum(status)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;index=main | reverse&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;| streamstats sum(count(status))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;any idea?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;Thanks&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 13:45:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-count-of-field-instead-of-just-count-it/m-p/558690#M158732</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2021-07-08T13:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: Add count of field instead of just count it</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-count-of-field-instead-of-just-count-it/m-p/558695#M158736</link>
      <description>&lt;P&gt;Can you provide some sample events?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 14:04:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-count-of-field-instead-of-just-count-it/m-p/558695#M158736</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-07-08T14:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: Add count of field instead of just count it</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-count-of-field-instead-of-just-count-it/m-p/558698#M158737</link>
      <description>&lt;P&gt;I do field extraction that the name is “status”, and value is “fail” or “success”.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;2021-07-06 23:11:12,197 INFO [app] fail , time[10] User: anonymous&lt;BR /&gt;2021-07-06 23:11:12,187 INFO [app] success, User: anonymous&lt;BR /&gt;2021-07-06 23:11:12,178 INFO [app] fail , time[10] User: anonymous&lt;BR /&gt;2021-07-06 23:11:12,167 INFO [app] success, User: anonymous&lt;BR /&gt;2021-07-06 23:11:12,159 INFO [app] fail , time[10] User: anonymous&lt;BR /&gt;2021-07-06 23:11:12,149 INFO [app] success, User: anonymous&lt;BR /&gt;2021-07-06 23:11:12,141 INFO [app] fail , time[10] User: anonymous&lt;BR /&gt;2021-07-06 23:11:12,131 INFO [app] success, User: anonymous&lt;BR /&gt;2021-07-06 23:11:12,134 INFO [app] success, User: anonymous&lt;BR /&gt;2021-07-06 23:11:12,138 INFO [app] success, User: anonymous&lt;/P&gt;&lt;P&gt;expected result:&lt;BR /&gt;fail 1&lt;BR /&gt;success 1&lt;BR /&gt;fail 2&lt;BR /&gt;success 2&lt;BR /&gt;fail 3&lt;BR /&gt;success 3&lt;BR /&gt;fail 4&lt;BR /&gt;success 4&lt;BR /&gt;success 5&lt;BR /&gt;success 6&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 14:15:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-count-of-field-instead-of-just-count-it/m-p/558698#M158737</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2021-07-08T14:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: Add count of field instead of just count it</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-count-of-field-instead-of-just-count-it/m-p/558700#M158739</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| streamstats count by status&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 08 Jul 2021 14:20:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-count-of-field-instead-of-just-count-it/m-p/558700#M158739</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-07-08T14:20:48Z</dc:date>
    </item>
  </channel>
</rss>

