<?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: Find Consecutive Results in a Time Span in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Find-Consecutive-Results-in-a-Time-Span/m-p/119223#M31970</link>
    <description>&lt;P&gt;You could use &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/streamstats"&gt;streamstats&lt;/A&gt; to get the previous and current value of count onto each event&lt;/P&gt;

&lt;P&gt;Let's refine your search: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=tt ListingQueue earliest=-2h 
| timechart span=10min count
| eval hour=strftime(_time,"%H:%M")
| streamstats current=f window=1 last(count) as last_count 
| table hour count last_count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now your alert condition could be &lt;CODE&gt;where count = 0 AND last_count=0&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Jan 2015 16:17:54 GMT</pubDate>
    <dc:creator>acharlieh</dc:creator>
    <dc:date>2015-01-27T16:17:54Z</dc:date>
    <item>
      <title>Find Consecutive Results in a Time Span</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-Consecutive-Results-in-a-Time-Span/m-p/119222#M31969</link>
      <description>&lt;P&gt;Hello &lt;/P&gt;

&lt;P&gt;I have created a search that monitors a queue and the number of transactions in a 10 minute span:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=tt ListingQueue earliest=-2h | timechart span=10min count | eval hour=strftime(_time,"%H:%M") | stats sum(count) as count by hour | fillnull value=NULL | eval status=if(count = 0, "TRUE", "FALSE") |
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I had to fillnull since the results that are null is what I am looking for but the blank field is not NULL. This search returns results like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;hour    count   status
08:40   14884   FALSE
08:50   19544   FALSE
09:00   30952   FALSE
09:10   18558   FALSE
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have this setup to run every 30 minutes. The problem is that every 30 minutes the alert condition is met as the 10 minute span changes and the count = 0 before it starts counting again in the 10 minute time frame.&lt;/P&gt;

&lt;P&gt;What I am trying to get it to do it alert me if status  = TRUE 2 times in a row. For example: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;hour    count   status
09:20   14884   TRUE
09:30   19544   TRUE
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any ideas on how I can accomplish this?&lt;BR /&gt;
Thanks for the help&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jan 2015 19:18:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-Consecutive-Results-in-a-Time-Span/m-p/119222#M31969</guid>
      <dc:creator>tkwaller</dc:creator>
      <dc:date>2015-01-26T19:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: Find Consecutive Results in a Time Span</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-Consecutive-Results-in-a-Time-Span/m-p/119223#M31970</link>
      <description>&lt;P&gt;You could use &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/streamstats"&gt;streamstats&lt;/A&gt; to get the previous and current value of count onto each event&lt;/P&gt;

&lt;P&gt;Let's refine your search: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=tt ListingQueue earliest=-2h 
| timechart span=10min count
| eval hour=strftime(_time,"%H:%M")
| streamstats current=f window=1 last(count) as last_count 
| table hour count last_count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now your alert condition could be &lt;CODE&gt;where count = 0 AND last_count=0&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jan 2015 16:17:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-Consecutive-Results-in-a-Time-Span/m-p/119223#M31970</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2015-01-27T16:17:54Z</dc:date>
    </item>
    <item>
      <title>Re: Find Consecutive Results in a Time Span</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-Consecutive-Results-in-a-Time-Span/m-p/119224#M31971</link>
      <description>&lt;P&gt;Ah yes this works. I knew I was going about it wrong. Thanks for the help sir!&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jan 2015 16:25:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-Consecutive-Results-in-a-Time-Span/m-p/119224#M31971</guid>
      <dc:creator>tkwaller</dc:creator>
      <dc:date>2015-01-27T16:25:05Z</dc:date>
    </item>
  </channel>
</rss>

