<?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: How to monitor the lasting of an event with a percentage condition with a CPU charge &amp;gt; 80%? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-monitor-the-lasting-of-an-event-with-a-percentage/m-p/383425#M111971</link>
    <description>&lt;P&gt;yes it's good with a lower value of CPU&lt;BR /&gt;
I think you have forgottent something in your code? i cant see anything about lasting&lt;/P&gt;</description>
    <pubDate>Tue, 21 May 2019 11:12:55 GMT</pubDate>
    <dc:creator>jip31</dc:creator>
    <dc:date>2019-05-21T11:12:55Z</dc:date>
    <item>
      <title>How to monitor the lasting of an event with a percentage condition with a CPU charge &gt; 80%?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-monitor-the-lasting-of-an-event-with-a-percentage/m-p/383421#M111967</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;

&lt;P&gt;I use the search below in order to monitore process with a CPU charge &amp;gt; 80%&lt;BR /&gt;
BUT&lt;BR /&gt;
What I exactly need is to monitore events where the lasting of the CPU charge &amp;gt; 80% is at least one minute&lt;BR /&gt;
Is there a finction for doing something like this?&lt;BR /&gt;
it's all the more complex than I have the beginning event time (_time) but I have not closure event time&lt;BR /&gt;
thanks for your help&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="tutu" sourcetype="perfmonmk:process" 
| where process_cpu_used_percent&amp;gt;80 
| bucket _time span=1m 
| stats avg(process_cpu_used_percent) as process_cpu_used_percent by host, _time 
| eval process_cpu_used_percent =round(process_cpu_used_percent, 1)." %" 
| table _time host process_cpu_used_percent 
| sort -_time limit=10
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 May 2019 08:21:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-monitor-the-lasting-of-an-event-with-a-percentage/m-p/383421#M111967</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-05-21T08:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to monitor the lasting of an event with a percentage condition with a CPU charge &gt; 80%?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-monitor-the-lasting-of-an-event-with-a-percentage/m-p/383422#M111968</link>
      <description>&lt;P&gt;You should put the &lt;CODE&gt;where&lt;/CODE&gt; condition later&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="tutu" sourcetype="perfmonmk:process" 
 | bucket _time span=1m 
 | stats avg(process_cpu_used_percent) as process_cpu_used_percent by host, _time 
 | where process_cpu_used_percent&amp;gt;80 
  ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 May 2019 09:09:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-monitor-the-lasting-of-an-event-with-a-percentage/m-p/383422#M111968</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2019-05-21T09:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to monitor the lasting of an event with a percentage condition with a CPU charge &gt; 80%?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-monitor-the-lasting-of-an-event-with-a-percentage/m-p/383423#M111969</link>
      <description>&lt;P&gt;no&lt;BR /&gt;
when i am doing this the search is very very long and I have no results&lt;BR /&gt;
moreover I would be able the results in a table with 3 fields : _time, host, and lasting&lt;BR /&gt;
lasting will be the lasting on a CPU process &amp;gt; 80%....&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 09:43:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-monitor-the-lasting-of-an-event-with-a-percentage/m-p/383423#M111969</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-05-21T09:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to monitor the lasting of an event with a percentage condition with a CPU charge &gt; 80%?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-monitor-the-lasting-of-an-event-with-a-percentage/m-p/383424#M111970</link>
      <description>&lt;P&gt;this search should be faster, as you are doing the stats before you do where clause.  The reason why you are not getting result is there won't be genuinely any average of CPU lasting &amp;gt; 80&lt;/P&gt;

&lt;P&gt;Try putting a lower value  of CPU  (say &amp;gt;20) and see if it yields report.&lt;BR /&gt;
Also &lt;CODE&gt;lasting&lt;/CODE&gt; is a concept which is same as averaging out a value for timespan. So in your case, your 1min is timespan for buckets and it averages out accordingly.&lt;/P&gt;

&lt;P&gt;Please see a quick simulation, using the internal logs&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="_introspection" host=* 
| bucket _time span=1m
| stats avg(data.mem_used) as mem_used by host,_time
| where mem_used &amp;gt; 300
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 May 2019 10:38:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-monitor-the-lasting-of-an-event-with-a-percentage/m-p/383424#M111970</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2019-05-21T10:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to monitor the lasting of an event with a percentage condition with a CPU charge &gt; 80%?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-monitor-the-lasting-of-an-event-with-a-percentage/m-p/383425#M111971</link>
      <description>&lt;P&gt;yes it's good with a lower value of CPU&lt;BR /&gt;
I think you have forgottent something in your code? i cant see anything about lasting&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 11:12:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-monitor-the-lasting-of-an-event-with-a-percentage/m-p/383425#M111971</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-05-21T11:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to monitor the lasting of an event with a percentage condition with a CPU charge &gt; 80%?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-monitor-the-lasting-of-an-event-with-a-percentage/m-p/383426#M111972</link>
      <description>&lt;P&gt;If I catch the field _time for an event where CPU &amp;gt;80% and I compare it with the field _time of the next event, if this next event is also an event where CPU &amp;gt;80% I am able to calculate the lasting of the process CPU &amp;gt;80% no??&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 11:26:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-monitor-the-lasting-of-an-event-with-a-percentage/m-p/383426#M111972</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-05-21T11:26:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to monitor the lasting of an event with a percentage condition with a CPU charge &gt; 80%?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-monitor-the-lasting-of-an-event-with-a-percentage/m-p/383427#M111973</link>
      <description>&lt;P&gt;Somebody told me about transaction function&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 11:43:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-monitor-the-lasting-of-an-event-with-a-percentage/m-p/383427#M111973</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-05-21T11:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to monitor the lasting of an event with a percentage condition with a CPU charge &gt; 80%?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-monitor-the-lasting-of-an-event-with-a-percentage/m-p/383428#M111974</link>
      <description>&lt;P&gt;i'm slightly confused by why you need lasting. When you do span=1m, it checks for the 1minute interval average. So if 80% cpu "lasts" for that whole 1 minute, then only the SPL will have an output&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 20:43:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-monitor-the-lasting-of-an-event-with-a-percentage/m-p/383428#M111974</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2019-05-21T20:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to monitor the lasting of an event with a percentage condition with a CPU charge &gt; 80%?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-monitor-the-lasting-of-an-event-with-a-percentage/m-p/383429#M111975</link>
      <description>&lt;P&gt;i trust you&lt;BR /&gt;
what I need is to monitore a 80% CPU lasting for a whole 1 minute&lt;BR /&gt;
so i consider that the search is goog &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;
thanks&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2019 05:38:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-monitor-the-lasting-of-an-event-with-a-percentage/m-p/383429#M111975</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-05-22T05:38:54Z</dc:date>
    </item>
  </channel>
</rss>

