<?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 can I get Streamstats to Calculate all Fields? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-Streamstats-to-Calculate-all-Fields/m-p/391590#M168745</link>
    <description>&lt;P&gt;I am using the following search which returns a table with three rows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    | streamstats current=f last(_time) as NewTime first(_time) as LastTask by Item
    | eval Duration=NewTime-_time
    | eval RunTime=(Duration/60)
    | table JobName, RunTime, _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The issue I am having is that my time is only caluculated for two of the rows, the earliest two. The final record is not calculating a time so I am getting the following:&lt;/P&gt;

&lt;P&gt;JobName,RunTime, _time&lt;BR /&gt;
Name1, ,5:00&lt;BR /&gt;
Name2,120,4:00&lt;BR /&gt;
Name3,60,2:00&lt;/P&gt;

&lt;P&gt;Is there a way I can force it to calculate the final time?&lt;/P&gt;</description>
    <pubDate>Thu, 21 Jun 2018 17:11:25 GMT</pubDate>
    <dc:creator>aohls</dc:creator>
    <dc:date>2018-06-21T17:11:25Z</dc:date>
    <item>
      <title>How can I get Streamstats to Calculate all Fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-Streamstats-to-Calculate-all-Fields/m-p/391590#M168745</link>
      <description>&lt;P&gt;I am using the following search which returns a table with three rows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    | streamstats current=f last(_time) as NewTime first(_time) as LastTask by Item
    | eval Duration=NewTime-_time
    | eval RunTime=(Duration/60)
    | table JobName, RunTime, _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The issue I am having is that my time is only caluculated for two of the rows, the earliest two. The final record is not calculating a time so I am getting the following:&lt;/P&gt;

&lt;P&gt;JobName,RunTime, _time&lt;BR /&gt;
Name1, ,5:00&lt;BR /&gt;
Name2,120,4:00&lt;BR /&gt;
Name3,60,2:00&lt;/P&gt;

&lt;P&gt;Is there a way I can force it to calculate the final time?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 17:11:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-Streamstats-to-Calculate-all-Fields/m-p/391590#M168745</guid>
      <dc:creator>aohls</dc:creator>
      <dc:date>2018-06-21T17:11:25Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get Streamstats to Calculate all Fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-Streamstats-to-Calculate-all-Fields/m-p/391591#M168746</link>
      <description>&lt;P&gt;The problem is that there is no last(_time) for row appearing first in result (would be the last result if sorted by _time), hence no calculation is done. What should the RunTime value for it?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 18:07:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-Streamstats-to-Calculate-all-Fields/m-p/391591#M168746</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-06-21T18:07:53Z</dc:date>
    </item>
  </channel>
</rss>

