<?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: Need help to write a query using Streamstats. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Need-help-to-write-a-query-using-Streamstats/m-p/462683#M130437</link>
    <description>&lt;P&gt;Here's a search with numeric values - that you can look at:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=splunkd kb=* 
| table _time sourcetype kb 
| eval threshold = if(kb&amp;lt;80,"UNDER","OVER")
| streamstats current=t window=3 list(kb) as last_three list(threshold) AS all_threshholds values(threshold) AS last3_threshhold 
| eval ALERT = if(last3_threshhold != "UNDER","All 3 were OVER","")
| eval GOOD = if(last3_threshhold != "OVER","Last 3 were all good","")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 01 Apr 2020 15:39:28 GMT</pubDate>
    <dc:creator>memarshall63</dc:creator>
    <dc:date>2020-04-01T15:39:28Z</dc:date>
    <item>
      <title>Need help to write a query using Streamstats.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-to-write-a-query-using-Streamstats/m-p/462681#M130435</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;

&lt;P&gt;i have onboarded the  Linux CPU logs using Splunk add on for linux. the requirement is , we need send an alert when we hitting the CPU utilization more 80 % and count for the continuously 3 times. Using streamstats command&lt;/P&gt;

&lt;P&gt;input is enabled for every 1200 seconds and alert will run every 30 mintues. &lt;/P&gt;

&lt;P&gt;Could you please help me to get the query.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2020 15:00:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-to-write-a-query-using-Streamstats/m-p/462681#M130435</guid>
      <dc:creator>sridharlakshman</dc:creator>
      <dc:date>2020-04-01T15:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to write a query using Streamstats.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-to-write-a-query-using-Streamstats/m-p/462682#M130436</link>
      <description>&lt;P&gt;How we did that was to pull together the list of inputs and then add a streamstats like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| streamstats current=t window=3 values(status) AS last_three by input_name 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=dbx_job_metrics 
| sort input_name _time 
| table input_name _time status
| streamstats current=t window=3 list(status) as last_three values(status) AS values_three by input_name 
| search values_three != "COMPLETED"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You'll need to adjust a little to get your &amp;gt; 80% in there..   but that's the basics of it.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2020 15:17:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-to-write-a-query-using-Streamstats/m-p/462682#M130436</guid>
      <dc:creator>memarshall63</dc:creator>
      <dc:date>2020-04-01T15:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to write a query using Streamstats.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-to-write-a-query-using-Streamstats/m-p/462683#M130437</link>
      <description>&lt;P&gt;Here's a search with numeric values - that you can look at:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=splunkd kb=* 
| table _time sourcetype kb 
| eval threshold = if(kb&amp;lt;80,"UNDER","OVER")
| streamstats current=t window=3 list(kb) as last_three list(threshold) AS all_threshholds values(threshold) AS last3_threshhold 
| eval ALERT = if(last3_threshhold != "UNDER","All 3 were OVER","")
| eval GOOD = if(last3_threshhold != "OVER","Last 3 were all good","")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 Apr 2020 15:39:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-to-write-a-query-using-Streamstats/m-p/462683#M130437</guid>
      <dc:creator>memarshall63</dc:creator>
      <dc:date>2020-04-01T15:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to write a query using Streamstats.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-to-write-a-query-using-Streamstats/m-p/462684#M130438</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | streamstats current=t window=3 count(eval(cpu&amp;gt;=80)) AS count80plus
| where count80plus==3
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 Apr 2020 16:03:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-to-write-a-query-using-Streamstats/m-p/462684#M130438</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2020-04-01T16:03:12Z</dc:date>
    </item>
  </channel>
</rss>

