<?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: last status changed time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/last-status-changed-time/m-p/545981#M154751</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161725"&gt;@roopeshetty&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;This should give you a start:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| streamstats current=f window=1 last(ProtectionStatus) as prev_status
| eval statuschange=if(ProtectionStatus!=prev_status,"true", "false")&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;There was a &lt;A href="https://community.splunk.com/t5/Splunk-Search/Time-from-a-search/m-p/545389" target="_self"&gt;similiar question&lt;/A&gt; recently. There is also another option using command "Delta" suggested by&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129090"&gt;@manjunathmeti&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;Ralph&lt;/P&gt;</description>
    <pubDate>Tue, 30 Mar 2021 09:18:09 GMT</pubDate>
    <dc:creator>rnowitzki</dc:creator>
    <dc:date>2021-03-30T09:18:09Z</dc:date>
    <item>
      <title>last status changed time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/last-status-changed-time/m-p/545969#M154744</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have this query , which will provide me the list of “Name” on which ProtectionStatus is OFF.&lt;/P&gt;&lt;P&gt;index=altiris sourcetype=altiris source=altiris_BGP_Excluded_WithREGION OR source=mi_input://altiris_BGP_Excluded_WithREGION | eval ProtectionStatus = if(Protectionstatus == 0, "OFF", "ON") | dedup Name | where ProtectionStatus="OFF"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ProtectionStatus goes OFF and ON frequently ( we run the query in every 6 hours). Here we need to add one more field or column which should show us the time (Date and time) when the last ProtectionStatus change happened (it can be either OFF to ON or ON to OFF). Can some one please help us on this.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 07:57:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/last-status-changed-time/m-p/545969#M154744</guid>
      <dc:creator>roopeshetty</dc:creator>
      <dc:date>2021-03-30T07:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: last status changed time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/last-status-changed-time/m-p/545981#M154751</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161725"&gt;@roopeshetty&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;This should give you a start:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| streamstats current=f window=1 last(ProtectionStatus) as prev_status
| eval statuschange=if(ProtectionStatus!=prev_status,"true", "false")&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;There was a &lt;A href="https://community.splunk.com/t5/Splunk-Search/Time-from-a-search/m-p/545389" target="_self"&gt;similiar question&lt;/A&gt; recently. There is also another option using command "Delta" suggested by&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129090"&gt;@manjunathmeti&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;Ralph&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 09:18:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/last-status-changed-time/m-p/545981#M154751</guid>
      <dc:creator>rnowitzki</dc:creator>
      <dc:date>2021-03-30T09:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: last status changed time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/last-status-changed-time/m-p/545988#M154754</link>
      <description>&lt;P&gt;Hi Ralph,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added the your query at the end of my query (as pasted below) and ran it. It gave me a new field "statuschange" which has value as "false". But actually I want to see the date and time when&amp;nbsp;the last&amp;nbsp;&lt;SPAN&gt;ProtectionStatus change happened (it can be either OFF to ON or ON to OFF).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;index=altiris sourcetype=altiris source=altiris_BGP_Excluded_WithREGION OR source=mi_input://altiris_BGP_Excluded_WithREGION | eval ProtectionStatus = if(Protectionstatus == 0, "OFF", "ON") | dedup Name | where ProtectionStatus="OFF" | streamstats current=f window=1 last(ProtectionStatus) as prev_status&lt;BR /&gt;| eval statuschange=if(ProtectionStatus!=prev_status,"true", "false")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 09:46:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/last-status-changed-time/m-p/545988#M154754</guid>
      <dc:creator>roopeshetty</dc:creator>
      <dc:date>2021-03-30T09:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: last status changed time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/last-status-changed-time/m-p/545989#M154755</link>
      <description>&lt;P&gt;You filtered on "OFF"&amp;nbsp; events before the streamstats, so you don't have any status changes any more after your query...&lt;BR /&gt;&lt;BR /&gt;I removed your where command:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=altiris sourcetype=altiris source=altiris_BGP_Excluded_WithREGION OR source=mi_input://altiris_BGP_Excluded_WithREGION 
| eval ProtectionStatus = if(Protectionstatus == 0, "OFF", "ON") 
| dedup Name 

| streamstats current=f window=1 last(ProtectionStatus) as prev_status
| eval statuschange=if(ProtectionStatus!=prev_status,"true", "false")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could now add a filter for statuschange=true, so you only see the events where a change of status happened.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where statuschange="true"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 09:57:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/last-status-changed-time/m-p/545989#M154755</guid>
      <dc:creator>rnowitzki</dc:creator>
      <dc:date>2021-03-30T09:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: last status changed time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/last-status-changed-time/m-p/546002#M154760</link>
      <description>&lt;P&gt;thanks&amp;nbsp;&lt;SPAN&gt;Ralph. I got the output now. I really appreciate&amp;nbsp;your help on this.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 12:27:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/last-status-changed-time/m-p/546002#M154760</guid>
      <dc:creator>roopeshetty</dc:creator>
      <dc:date>2021-03-30T12:27:43Z</dc:date>
    </item>
  </channel>
</rss>

