<?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 accum command examples in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/accum-command-examples/m-p/301770#M5406</link>
    <description>&lt;P&gt;Could anyone please provide the example to learn the accum command.&lt;BR /&gt;
i never used this command so i need some example to learn.&lt;/P&gt;</description>
    <pubDate>Tue, 03 Apr 2018 15:39:24 GMT</pubDate>
    <dc:creator>logloganathan</dc:creator>
    <dc:date>2018-04-03T15:39:24Z</dc:date>
    <item>
      <title>accum command examples</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/accum-command-examples/m-p/301770#M5406</link>
      <description>&lt;P&gt;Could anyone please provide the example to learn the accum command.&lt;BR /&gt;
i never used this command so i need some example to learn.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Apr 2018 15:39:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/accum-command-examples/m-p/301770#M5406</guid>
      <dc:creator>logloganathan</dc:creator>
      <dc:date>2018-04-03T15:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: accum command examples</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/accum-command-examples/m-p/301771#M5407</link>
      <description>&lt;P&gt;Hi @logloganathan, &lt;/P&gt;

&lt;P&gt;The accum command calculates a running total or sum of the numbers. The accumulated sum can be returned to either the same field, or a newfield that you specify.&lt;/P&gt;

&lt;P&gt;See this example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| gentimes start=1 end=10 | eval sr_no=1 | accum sr_no | table sr_no 

| gentimes start=1 end=10 | eval sr_no=2 | accum sr_no | table sr_no 

| gentimes start=1 end=10 | eval sr_no=3 | accum sr_no as NO  | table sr_no NO
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.0.3/SearchReference/Accum"&gt;https://docs.splunk.com/Documentation/Splunk/7.0.3/SearchReference/Accum&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Apr 2018 15:47:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/accum-command-examples/m-p/301771#M5407</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-04-03T15:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: accum command examples</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/accum-command-examples/m-p/301772#M5408</link>
      <description>&lt;P&gt;The &lt;CODE&gt;accum&lt;/CODE&gt; command calculates a running total of the values in a specified field. Here's a very short run-anywhere example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval a=5 
| append 
    [| makeresults 
    | eval a=1 ] 
| append 
    [| makeresults 
    | eval a=7 ] 
| accum a AS b
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will create a table with the _time that the events were generated, the field &lt;CODE&gt;a&lt;/CODE&gt; (which is assigned the values 5, 1, and 7) and the field &lt;CODE&gt;b&lt;/CODE&gt; (which contains a running total of the values from field &lt;CODE&gt;a&lt;/CODE&gt;: 5, 6, 13). If you don't specify the &lt;CODE&gt;AS&lt;/CODE&gt; clause, the accum command will store the running total in the source field:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval a=5 
| append 
    [| makeresults 
    | eval a=1 ] 
| append 
    [| makeresults 
    | eval a=7 ] 
| accum a
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will just give you a table with the _time field and the field &lt;CODE&gt;a&lt;/CODE&gt;, which no longer contains the original source values but only the running total of the source values.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Apr 2018 15:51:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/accum-command-examples/m-p/301772#M5408</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-04-03T15:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: accum command examples</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/accum-command-examples/m-p/301773#M5409</link>
      <description>&lt;P&gt;You should read splunk documentation on &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Accum"&gt;accum&lt;/A&gt; command:&lt;/P&gt;

&lt;P&gt;Try the following run anywhere search based on your Splunk's _internal index&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=splunkd log_level!="INFO"
| stats count as Total by component
| accum Total as cumulativeTotal
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can use accum command for generating serial number for number of results displayed in a table&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=splunkd log_level!="INFO"
| stats count as Total by component
| eval sno=1
| accum sno
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can also learn &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Streamstats"&gt;streamstats&lt;/A&gt; command which can perform the operation of accum command and much more. Also Similar to how accum command performs cumulative total of specific field in streaming manner, &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Delta"&gt;delta&lt;/A&gt; command can give you cumulative difference, so read about that as well.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Apr 2018 15:51:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/accum-command-examples/m-p/301773#M5409</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-04-03T15:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: accum command examples</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/accum-command-examples/m-p/301774#M5410</link>
      <description>&lt;P&gt;wow...very detailed explanation&lt;/P&gt;</description>
      <pubDate>Wed, 04 Apr 2018 04:38:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/accum-command-examples/m-p/301774#M5410</guid>
      <dc:creator>logloganathan</dc:creator>
      <dc:date>2018-04-04T04:38:43Z</dc:date>
    </item>
  </channel>
</rss>

