<?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: How to search the cumulative sum for multiple fields and chart them by day? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-cumulative-sum-for-multiple-fields-and-chart/m-p/183985#M52979</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Try with&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;....| streamstats sum(AWS-*) as AWS-*_accum |timechart    AWS-*_accum  span=1d 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 30 Jun 2015 13:38:05 GMT</pubDate>
    <dc:creator>ngatchasandra</dc:creator>
    <dc:date>2015-06-30T13:38:05Z</dc:date>
    <item>
      <title>How to search the cumulative sum for multiple fields and chart them by day?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-cumulative-sum-for-multiple-fields-and-chart/m-p/183981#M52975</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;

&lt;P&gt;I am trying to get a cumulative sum of multiple fields and then chart them. Problem is, I can use accum on only ONE field at a time. The fields are dynamic, so I need something which will calculate the cumulative value for fields which start with AWS-* &lt;/P&gt;

&lt;P&gt;The fields look like below&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/439i37E9BC4C5C69FB16/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;There can be other tags too like AWS-S3 etc depending on the filters which people pick. So Is there a way to get a cumulative value of each field as its own field ( cumulative value of AWs-EC2 as accum _AWS-EC2etc) ?&lt;/P&gt;

&lt;P&gt;Search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=blah sourcetype=blah  source="*blah-*"  Center=ABC123|timechart span=1d sum(UnBlendedCost) as Cost by ProductName_Tag|accum AWS-EC2 as accum_AWS-EC2|accum AWS-EMR as accum_AWS-EMR
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;UPDATE: Updated the question. I am trying to get the cumulative value by Day &lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2015 13:00:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-cumulative-sum-for-multiple-fields-and-chart/m-p/183981#M52975</guid>
      <dc:creator>theouhuios</dc:creator>
      <dc:date>2015-06-30T13:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the cumulative sum for multiple fields and chart them by day?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-cumulative-sum-for-multiple-fields-and-chart/m-p/183982#M52976</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | streamstats sum(AWS-*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats sum(AWS-*)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Jun 2015 13:20:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-cumulative-sum-for-multiple-fields-and-chart/m-p/183982#M52976</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-06-30T13:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the cumulative sum for multiple fields and chart them by day?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-cumulative-sum-for-multiple-fields-and-chart/m-p/183983#M52977</link>
      <description>&lt;P&gt;Sorry, I should have been more Clear. I need to get a cumulative value by each day so that I can just chart the cumulative values of all AWS-* , stack them up which would give the total value for the day along with the ProductName.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2015 13:30:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-cumulative-sum-for-multiple-fields-and-chart/m-p/183983#M52977</guid>
      <dc:creator>theouhuios</dc:creator>
      <dc:date>2015-06-30T13:30:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the cumulative sum for multiple fields and chart them by day?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-cumulative-sum-for-multiple-fields-and-chart/m-p/183984#M52978</link>
      <description>&lt;P&gt;What search command are you currently using ? &lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2015 13:34:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-cumulative-sum-for-multiple-fields-and-chart/m-p/183984#M52978</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2015-06-30T13:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the cumulative sum for multiple fields and chart them by day?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-cumulative-sum-for-multiple-fields-and-chart/m-p/183985#M52979</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Try with&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;....| streamstats sum(AWS-*) as AWS-*_accum |timechart    AWS-*_accum  span=1d 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Jun 2015 13:38:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-cumulative-sum-for-multiple-fields-and-chart/m-p/183985#M52979</guid>
      <dc:creator>ngatchasandra</dc:creator>
      <dc:date>2015-06-30T13:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the cumulative sum for multiple fields and chart them by day?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-cumulative-sum-for-multiple-fields-and-chart/m-p/183986#M52980</link>
      <description>&lt;P&gt;OK, based on your clarification, do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | bucket _time span=1d | stats sum(AWS-*) by _time | addcoltotals
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or this (still not sure if you need accum or sum):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | bucket _time span=1d | streamstats sum(AWS-*) by _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The &lt;CODE&gt;bucket&lt;/CODE&gt; part may not be necessary (if your data matches what you show).&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2015 13:40:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-cumulative-sum-for-multiple-fields-and-chart/m-p/183986#M52980</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-06-30T13:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the cumulative sum for multiple fields and chart them by day?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-cumulative-sum-for-multiple-fields-and-chart/m-p/183987#M52981</link>
      <description>&lt;P&gt;Updated the search&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2015 13:42:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-cumulative-sum-for-multiple-fields-and-chart/m-p/183987#M52981</guid>
      <dc:creator>theouhuios</dc:creator>
      <dc:date>2015-06-30T13:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the cumulative sum for multiple fields and chart them by day?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-cumulative-sum-for-multiple-fields-and-chart/m-p/183988#M52982</link>
      <description>&lt;P&gt;try like:&lt;/P&gt;

&lt;P&gt;...| bucket _time span=1d |streamstats sum(AWS-*) by _time |&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2015 13:46:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-cumulative-sum-for-multiple-fields-and-chart/m-p/183988#M52982</guid>
      <dc:creator>fdi01</dc:creator>
      <dc:date>2015-06-30T13:46:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the cumulative sum for multiple fields and chart them by day?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-cumulative-sum-for-multiple-fields-and-chart/m-p/183989#M52983</link>
      <description>&lt;P&gt;Updated the question with the search. AWs-* field are basically values of field called ProductName. &lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2015 13:46:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-cumulative-sum-for-multiple-fields-and-chart/m-p/183989#M52983</guid>
      <dc:creator>theouhuios</dc:creator>
      <dc:date>2015-06-30T13:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the cumulative sum for multiple fields and chart them by day?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-cumulative-sum-for-multiple-fields-and-chart/m-p/183990#M52984</link>
      <description>&lt;P&gt;Try also with accum command which create a cumulative sum:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ....| accum sum AWS-* as AWS-*_accum |timechart    AWS-*_accum  span=1d 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Jun 2015 13:49:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-cumulative-sum-for-multiple-fields-and-chart/m-p/183990#M52984</guid>
      <dc:creator>ngatchasandra</dc:creator>
      <dc:date>2015-06-30T13:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the cumulative sum for multiple fields and chart them by day?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-cumulative-sum-for-multiple-fields-and-chart/m-p/183991#M52985</link>
      <description>&lt;P&gt;This wouldn't work . If I do it after the timechart it would give me the same value since at a given _time value there is only one corresponding AWS-EC2 or AWS-EMR value. If I do this before my timechart, there is no field called AWS-*&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2015 13:51:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-cumulative-sum-for-multiple-fields-and-chart/m-p/183991#M52985</guid>
      <dc:creator>theouhuios</dc:creator>
      <dc:date>2015-06-30T13:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the cumulative sum for multiple fields and chart them by day?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-cumulative-sum-for-multiple-fields-and-chart/m-p/183992#M52986</link>
      <description>&lt;P&gt;addcoltotals will give me a cumulative value for all the fields.. Problem is I need it to add by day.. Like accum which keeps adding the field above the the current field and keeps going on. This would basically give me the TOTAL cost till that day, for everyday.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2015 13:55:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-cumulative-sum-for-multiple-fields-and-chart/m-p/183992#M52986</guid>
      <dc:creator>theouhuios</dc:creator>
      <dc:date>2015-06-30T13:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the cumulative sum for multiple fields and chart them by day?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-cumulative-sum-for-multiple-fields-and-chart/m-p/183993#M52987</link>
      <description>&lt;P&gt;Amazing. Such a simple function and it solved the issue. &lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2015 14:00:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-cumulative-sum-for-multiple-fields-and-chart/m-p/183993#M52987</guid>
      <dc:creator>theouhuios</dc:creator>
      <dc:date>2015-06-30T14:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the cumulative sum for multiple fields and chart them by day?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-cumulative-sum-for-multiple-fields-and-chart/m-p/183994#M52988</link>
      <description>&lt;P&gt;This will work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  index=blah sourcetype=blah  source="*blah-*"  Center=ABC123|timechart span=1d sum(UnBlendedCost) as Cost by ProductName_Tag | reverse | streamstats current=t sum(AWS*) BY _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But I think you are not looking for a running total (which is what &lt;CODE&gt;accum&lt;/CODE&gt; and &lt;CODE&gt;streamstats&lt;/CODE&gt; do) but rather a daily sum, right?  If so then do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  index=blah sourcetype=blah  source="*blah-*"  Center=ABC123|timechart span=1d sum(UnBlendedCost) as Cost by ProductName_Tag | reverse | stats sum(AWS*) BY _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or, to keep the table as-is and just add a column, do this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  index=blah sourcetype=blah  source="*blah-*"  Center=ABC123|timechart span=1d sum(UnBlendedCost) as Cost by ProductName_Tag | reverse | eventstats sum(AWS*) BY _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Jun 2015 14:32:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-cumulative-sum-for-multiple-fields-and-chart/m-p/183994#M52988</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-06-30T14:32:42Z</dc:date>
    </item>
  </channel>
</rss>

