<?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 How to convert a cumulative total into a rate in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-a-cumulative-total-into-a-rate/m-p/120891#M184062</link>
    <description>&lt;P&gt;I have this field which display the total number of transactions since the server has been started. I need to find out our transaction rate and I can't seem to do this in Splunk.&lt;BR /&gt;
Our stats gets collected every 5 minutes and look something like this:&lt;/P&gt;

&lt;P&gt;01:10am Messages=1000&lt;BR /&gt;
01:15am Messages=1500&lt;BR /&gt;
01:20am Messages=2000&lt;BR /&gt;
etc..&lt;BR /&gt;
That means that between 1:10 and 1:15 the server processed 500 transactions and that's the result I need to get from Splunk so that I can calculate our transactions per second rate.&lt;/P&gt;

&lt;P&gt;As far as I can tell Splunk would need to know the previous 5 minute value and compare to the current value of the field.&lt;/P&gt;

&lt;P&gt;I tried this but it doesn't work as I get the accumulated total:&lt;BR /&gt;
| stats sum(eval(Msgs/300)) as Trans by host&lt;/P&gt;

&lt;P&gt;Thanks for any help.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Oct 2013 19:59:50 GMT</pubDate>
    <dc:creator>adriangrassi</dc:creator>
    <dc:date>2013-10-29T19:59:50Z</dc:date>
    <item>
      <title>How to convert a cumulative total into a rate</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-a-cumulative-total-into-a-rate/m-p/120891#M184062</link>
      <description>&lt;P&gt;I have this field which display the total number of transactions since the server has been started. I need to find out our transaction rate and I can't seem to do this in Splunk.&lt;BR /&gt;
Our stats gets collected every 5 minutes and look something like this:&lt;/P&gt;

&lt;P&gt;01:10am Messages=1000&lt;BR /&gt;
01:15am Messages=1500&lt;BR /&gt;
01:20am Messages=2000&lt;BR /&gt;
etc..&lt;BR /&gt;
That means that between 1:10 and 1:15 the server processed 500 transactions and that's the result I need to get from Splunk so that I can calculate our transactions per second rate.&lt;/P&gt;

&lt;P&gt;As far as I can tell Splunk would need to know the previous 5 minute value and compare to the current value of the field.&lt;/P&gt;

&lt;P&gt;I tried this but it doesn't work as I get the accumulated total:&lt;BR /&gt;
| stats sum(eval(Msgs/300)) as Trans by host&lt;/P&gt;

&lt;P&gt;Thanks for any help.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2013 19:59:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-a-cumulative-total-into-a-rate/m-p/120891#M184062</guid>
      <dc:creator>adriangrassi</dc:creator>
      <dc:date>2013-10-29T19:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a cumulative total into a rate</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-a-cumulative-total-into-a-rate/m-p/120892#M184063</link>
      <description>&lt;P&gt;&lt;CODE&gt;...| table _time Messages | delta Messages as Current | eval TransRate = Curr / 300&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;/k&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2013 21:26:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-a-cumulative-total-into-a-rate/m-p/120892#M184063</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-10-29T21:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a cumulative total into a rate</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-a-cumulative-total-into-a-rate/m-p/120893#M184064</link>
      <description>&lt;P&gt;I was able to finally get this working using the following query:&lt;/P&gt;

&lt;P&gt;search | bucket _time span=5m | stats sum(eval(Msgs)) as 5MinCount by host _time | delta 5MinCount | sort _time | stats latest by host | rename latest(delta(5MinCount)) as delta | stats sum(eval(delta/300)) as Transactions_per_sec by host&lt;/P&gt;

&lt;P&gt;This query above takes 2 samples of a cumulative total and finds the difference between them and then calculates the rate while ignoring the 1st set of delta data which is invalid since it has nothing to compare against.&lt;/P&gt;

&lt;P&gt;Hopefully this helps someone else in the same situation.&lt;BR /&gt;
For the record I still think that converting a cumulative total into a transaction rate should have been its own function in Splunk.&lt;/P&gt;

&lt;P&gt;Thanks, &lt;BR /&gt;
-Adrian&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:11:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-a-cumulative-total-into-a-rate/m-p/120893#M184064</guid>
      <dc:creator>adriangrassi</dc:creator>
      <dc:date>2020-09-28T15:11:03Z</dc:date>
    </item>
  </channel>
</rss>

