<?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 latest for eventstats does not work in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/latest-for-eventstats-does-not-work/m-p/157782#M44444</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I try to use the &lt;CODE&gt;latest()&lt;/CODE&gt; option of eventstats in the following way:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eventstats latest(Status) AS Status_last by Application |sort 0 _time| dedup _raw| table _time  Status Status_last 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In fact, I used a regex to define "Status" in a log line and I want to display the Current Status (current log line) and the status value of the previous logs line. &lt;/P&gt;

&lt;P&gt;As below the problem is the Status_last raised is not good. &lt;/P&gt;

&lt;P&gt;_time                               Status             Status_last&lt;BR /&gt;
2015-03-31 19:28:05 DEGRADED    OPERATIONAL &lt;BR /&gt;
2015-03-31 19:29:05 OPERATIONAL &lt;STRONG&gt;OPERATIONAL&lt;/STRONG&gt; &amp;lt;= instead of Degraded&lt;/P&gt;

&lt;P&gt;Please help ! !!&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 06:54:11 GMT</pubDate>
    <dc:creator>collier31200</dc:creator>
    <dc:date>2020-09-29T06:54:11Z</dc:date>
    <item>
      <title>latest for eventstats does not work</title>
      <link>https://community.splunk.com/t5/Splunk-Search/latest-for-eventstats-does-not-work/m-p/157782#M44444</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I try to use the &lt;CODE&gt;latest()&lt;/CODE&gt; option of eventstats in the following way:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eventstats latest(Status) AS Status_last by Application |sort 0 _time| dedup _raw| table _time  Status Status_last 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In fact, I used a regex to define "Status" in a log line and I want to display the Current Status (current log line) and the status value of the previous logs line. &lt;/P&gt;

&lt;P&gt;As below the problem is the Status_last raised is not good. &lt;/P&gt;

&lt;P&gt;_time                               Status             Status_last&lt;BR /&gt;
2015-03-31 19:28:05 DEGRADED    OPERATIONAL &lt;BR /&gt;
2015-03-31 19:29:05 OPERATIONAL &lt;STRONG&gt;OPERATIONAL&lt;/STRONG&gt; &amp;lt;= instead of Degraded&lt;/P&gt;

&lt;P&gt;Please help ! !!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 06:54:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/latest-for-eventstats-does-not-work/m-p/157782#M44444</guid>
      <dc:creator>collier31200</dc:creator>
      <dc:date>2020-09-29T06:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: latest for eventstats does not work</title>
      <link>https://community.splunk.com/t5/Splunk-Search/latest-for-eventstats-does-not-work/m-p/157783#M44445</link>
      <description>&lt;P&gt;&lt;CODE&gt;latest(Status)&lt;/CODE&gt; finds the most recent value of &lt;CODE&gt;Status&lt;/CODE&gt;, not the previous value.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2015 13:07:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/latest-for-eventstats-does-not-work/m-p/157783#M44445</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-08-10T13:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: latest for eventstats does not work</title>
      <link>https://community.splunk.com/t5/Splunk-Search/latest-for-eventstats-does-not-work/m-p/157784#M44446</link>
      <description>&lt;P&gt;Therefore how could I find the previous value ?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2015 13:14:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/latest-for-eventstats-does-not-work/m-p/157784#M44446</guid>
      <dc:creator>collier31200</dc:creator>
      <dc:date>2015-08-10T13:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: latest for eventstats does not work</title>
      <link>https://community.splunk.com/t5/Splunk-Search/latest-for-eventstats-does-not-work/m-p/157785#M44447</link>
      <description>&lt;P&gt;OK, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | dedup _raw | reverse | streamstats current=f last(Status) AS PrevStatus BY Application | reverse | dedup Application | table _time Applicatoin Status PrevStatus
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Aug 2015 13:22:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/latest-for-eventstats-does-not-work/m-p/157785#M44447</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-08-10T13:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: latest for eventstats does not work</title>
      <link>https://community.splunk.com/t5/Splunk-Search/latest-for-eventstats-does-not-work/m-p/157786#M44448</link>
      <description>&lt;P&gt;Perfect ! That's work ! Thanks a lot&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2015 13:27:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/latest-for-eventstats-does-not-work/m-p/157786#M44448</guid>
      <dc:creator>collier31200</dc:creator>
      <dc:date>2015-08-10T13:27:38Z</dc:date>
    </item>
  </channel>
</rss>

