<?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 sum all average values within the hour and timechart only the latest? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-sum-all-average-values-within-the-hour-and-timechart-only/m-p/205292#M59674</link>
    <description>&lt;P&gt;that did it! thank you again!&lt;/P&gt;</description>
    <pubDate>Thu, 14 Apr 2016 19:52:03 GMT</pubDate>
    <dc:creator>kamgineer</dc:creator>
    <dc:date>2016-04-14T19:52:03Z</dc:date>
    <item>
      <title>how to sum all average values within the hour and timechart only the latest?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-sum-all-average-values-within-the-hour-and-timechart-only/m-p/205286#M59668</link>
      <description>&lt;P&gt;I guess my question is a little hard to explain... so let me start by giving you an example of the data I'm working with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2016-04-14 09:12:02.393040   VolID=164   Name=qai-mqa2qa                       alloc=4000 used=0    service=mssql      database=qai-qa    
2016-04-14 09:12:02.393040   VolID=162   Name=sf-ny2-vm-win-9                  alloc=2000 used=937  service=vmware     vmware_os=windows   
2016-04-14 09:12:02.393040   VolID=157   Name=sf-ny2-vm-win-10                 alloc=2000 used=343  service=vmware     vmware_os=windows   
2016-04-14 09:12:02.393040   VolID=156   Name=exchange-ex23-1                  alloc=2000 used=805  service=exchange  

2016-04-14 10:12:02.393040   VolID=164   Name=qai-mqa2qa                       alloc=4000 used=0    service=mssql      database=qai-qa    
2016-04-14 10:12:02.393040   VolID=162   Name=sf-ny2-vm-win-9                  alloc=2000 used=937  service=vmware     vmware_os=windows   
2016-04-14 10:12:02.393040   VolID=157   Name=sf-ny2-vm-win-10                 alloc=2000 used=343  service=vmware     vmware_os=windows   
2016-04-14 10:12:02.393040   VolID=156   Name=exchange-ex23-1                  alloc=2000 used=805  service=exchange  

2016-04-14 11:12:02.393040   VolID=164   Name=qai-mqa2qa                       alloc=4000 used=0    service=mssql      database=qai-qa    
2016-04-14 11:12:02.393040   VolID=162   Name=sf-ny2-vm-win-9                  alloc=2000 used=937  service=vmware     vmware_os=windows   
2016-04-14 11:12:02.393040   VolID=157   Name=sf-ny2-vm-win-10                 alloc=2000 used=343  service=vmware     vmware_os=windows   
2016-04-14 11:12:02.393040   VolID=156   Name=exchange-ex23-1                  alloc=2000 used=805  service=exchange  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So, "about" every hour I send the above data to Splunk. I say "about" every hour because it can sometimes be several times an hour.  The only unique thing about every "dump" is the exact time stamp.  For every "dump" data, all of the time stamps will be the same for that dump.  &lt;/P&gt;

&lt;P&gt;Is there a way to sum up all of the data by "service" for every uniq dump?&lt;/P&gt;

&lt;P&gt;For example. something like this works (except for the time when there is more than one "dump" per hour):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=solidfire service host=sf.ny2.hcmny.com| timechart span=1hr sum(used) by service
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And for part 2 of the question, how would i only display the "most recent" sum?&lt;BR /&gt;
Something like this works, but when I put it in a dashboard, the sum seems to grow to a cumulative sum, instead of the "latest" sum:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=solidfire service host=sf.ny2.hcmny.com| timechart span=1hr sum(used) by service |tail 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So I want my end result to look something like this:&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/1242i01C50D591A9C28F8/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 13:59:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-sum-all-average-values-within-the-hour-and-timechart-only/m-p/205286#M59668</guid>
      <dc:creator>kamgineer</dc:creator>
      <dc:date>2016-04-14T13:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: how to sum all average values within the hour and timechart only the latest?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-sum-all-average-values-within-the-hour-and-timechart-only/m-p/205287#M59669</link>
      <description>&lt;P&gt;Answer 1 : Use this to group your summary by the dumps (assuming same timestamp as stated)&lt;BR /&gt;
&lt;STRONG&gt;Updated&lt;/STRONG&gt; corrected typo on over_time, it should be over _time&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=solidfire service host=sf.ny2.hcmny.com | bucket span=1m _time |chart sum(used) over _time by service
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Answer 2: MOst recent sum&lt;/P&gt;

&lt;P&gt;Working query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=solidfire service host=sf.ny2.hcmny.com  | eventstats max(_time) as max by service | where _time=max  | stats sum(used) by service
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;other attempts&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=solidfire service host=sf.ny2.hcmny.com | bucket span=1m _time | dedup _time | stats sum(used) by service
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=solidfire service host=sf.ny2.hcmny.com | bucket span=1m _time | stats latest(used) as used by service | stats sum(used) by service
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Apr 2016 19:11:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-sum-all-average-values-within-the-hour-and-timechart-only/m-p/205287#M59669</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-04-14T19:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to sum all average values within the hour and timechart only the latest?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-sum-all-average-values-within-the-hour-and-timechart-only/m-p/205288#M59670</link>
      <description>&lt;P&gt;hi, and thank you!&lt;/P&gt;

&lt;P&gt;So Answer #1 looks good, I didn't know about the "over _time" command,  thank you, &lt;/P&gt;

&lt;P&gt;Answer #2 on the other hand does not give me the right results, the sum numbers are definitely wrong, see stats below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;service sum(used)
dpm 1662
exchange    804
mssql   1
oracle  7516
vmware  277
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Apr 2016 19:34:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-sum-all-average-values-within-the-hour-and-timechart-only/m-p/205288#M59670</guid>
      <dc:creator>kamgineer</dc:creator>
      <dc:date>2016-04-14T19:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to sum all average values within the hour and timechart only the latest?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-sum-all-average-values-within-the-hour-and-timechart-only/m-p/205289#M59671</link>
      <description>&lt;P&gt;For Answer 2, which query did you try?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 19:38:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-sum-all-average-values-within-the-hour-and-timechart-only/m-p/205289#M59671</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-04-14T19:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: how to sum all average values within the hour and timechart only the latest?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-sum-all-average-values-within-the-hour-and-timechart-only/m-p/205290#M59672</link>
      <description>&lt;P&gt;i tried both:&lt;/P&gt;

&lt;P&gt;1) &lt;CODE&gt;index=solidfire service host=sf.ny2.hcmny.com | bucket span=1m _time | dedup _time | stats sum(used) by service&lt;/CODE&gt;&lt;BR /&gt;
results:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;service sum(used)
dpm          5995
exchange    4338
mssql           1180
oracle          0
vmware  57555
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;2) &lt;CODE&gt;index=solidfire service host=sf.ny2.hcmny.com | bucket span=1m _time | stats latest(used) as used by service | stats sum(used) by service&lt;/CODE&gt;&lt;BR /&gt;
results:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;service sum(used)
dpm         1662
exchange    804
mssql           1
oracle          7516
vmware           277
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Apr 2016 19:41:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-sum-all-average-values-within-the-hour-and-timechart-only/m-p/205290#M59672</guid>
      <dc:creator>kamgineer</dc:creator>
      <dc:date>2016-04-14T19:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to sum all average values within the hour and timechart only the latest?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-sum-all-average-values-within-the-hour-and-timechart-only/m-p/205291#M59673</link>
      <description>&lt;P&gt;Give this a try &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=solidfire service host=sf.ny2.hcmny.com  | eventstats max(_time) as max by service | where _time=max  | stats sum(used) by service
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Apr 2016 19:49:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-sum-all-average-values-within-the-hour-and-timechart-only/m-p/205291#M59673</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-04-14T19:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to sum all average values within the hour and timechart only the latest?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-sum-all-average-values-within-the-hour-and-timechart-only/m-p/205292#M59674</link>
      <description>&lt;P&gt;that did it! thank you again!&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 19:52:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-sum-all-average-values-within-the-hour-and-timechart-only/m-p/205292#M59674</guid>
      <dc:creator>kamgineer</dc:creator>
      <dc:date>2016-04-14T19:52:03Z</dc:date>
    </item>
  </channel>
</rss>

