<?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: Average CPU Usage in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Average-CPU-Usage/m-p/156950#M44163</link>
    <description>&lt;P&gt;Hi mark.chuman,&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;timechart&lt;/CODE&gt; will do aggregation on the event values, if you don't need/want that to happen use &lt;CODE&gt;stats&lt;/CODE&gt; or &lt;CODE&gt;chart&lt;/CODE&gt; like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=perfstats host=servername | stats avg("%_Privileged_Time") AS avg_PrivTime max("%_Privileged_Time") AS max_PrivTime min("%_Privileged_Time") AS min_PrivTime by host, _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=perfstats host=servername | chart avg("%_Privileged_Time") AS avg_PrivTime max("%_Privileged_Time") AS max_PrivTime min("%_Privileged_Time") AS min_PrivTime over _time by host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Both results are basically the same like using timechart, but without the aggregation.&lt;/P&gt;

&lt;P&gt;hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
    <pubDate>Thu, 11 Dec 2014 14:59:40 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2014-12-11T14:59:40Z</dc:date>
    <item>
      <title>Average CPU Usage</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-CPU-Usage/m-p/156949#M44162</link>
      <description>&lt;P&gt;Trying to create a useful CPU usage search, but coming up short.  This search does not reflect what is actually being used for some reason:&lt;/P&gt;

&lt;P&gt;index=perfstats host=servername | timechart avg("%_Privileged_Time") by host&lt;/P&gt;

&lt;P&gt;For example, when I compare to what the server is actually using to what the search is reporting, the search is coming back extremely low and doesn't match up with actual usage.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:25:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-CPU-Usage/m-p/156949#M44162</guid>
      <dc:creator>mark_chuman</dc:creator>
      <dc:date>2020-09-28T18:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: Average CPU Usage</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-CPU-Usage/m-p/156950#M44163</link>
      <description>&lt;P&gt;Hi mark.chuman,&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;timechart&lt;/CODE&gt; will do aggregation on the event values, if you don't need/want that to happen use &lt;CODE&gt;stats&lt;/CODE&gt; or &lt;CODE&gt;chart&lt;/CODE&gt; like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=perfstats host=servername | stats avg("%_Privileged_Time") AS avg_PrivTime max("%_Privileged_Time") AS max_PrivTime min("%_Privileged_Time") AS min_PrivTime by host, _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=perfstats host=servername | chart avg("%_Privileged_Time") AS avg_PrivTime max("%_Privileged_Time") AS max_PrivTime min("%_Privileged_Time") AS min_PrivTime over _time by host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Both results are basically the same like using timechart, but without the aggregation.&lt;/P&gt;

&lt;P&gt;hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Thu, 11 Dec 2014 14:59:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-CPU-Usage/m-p/156950#M44163</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-12-11T14:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: Average CPU Usage</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-CPU-Usage/m-p/156951#M44164</link>
      <description>&lt;P&gt;many thanks for this and it's a big help.  I'm able to use this search to effectively track the average CPU consumption for the servers, but when I say trend it out over time (7+ days for example), it doesn't look very clean as in the trend lines are actually lines, they appear more as bars.&lt;/P&gt;

&lt;P&gt;search - index=perfstats host=servername | chart avg("%_Processor_Time") over _time by host&lt;/P&gt;

&lt;P&gt;I'll post an image..&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:25:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-CPU-Usage/m-p/156951#M44164</guid>
      <dc:creator>mark_chuman</dc:creator>
      <dc:date>2020-09-28T18:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: Average CPU Usage</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-CPU-Usage/m-p/156952#M44165</link>
      <description>&lt;P&gt;not enough karma to upload image &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Dec 2014 15:34:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-CPU-Usage/m-p/156952#M44165</guid>
      <dc:creator>mark_chuman</dc:creator>
      <dc:date>2014-12-11T15:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: Average CPU Usage</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-CPU-Usage/m-p/156953#M44166</link>
      <description>&lt;P&gt;but for example, this search comes back very clean in the display &lt;/P&gt;

&lt;P&gt;index=perfstats host=servername | timechart avg("%_Idle_Time") by host&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:25:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-CPU-Usage/m-p/156953#M44166</guid>
      <dc:creator>mark_chuman</dc:creator>
      <dc:date>2020-09-28T18:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: Average CPU Usage</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-CPU-Usage/m-p/156954#M44167</link>
      <description>&lt;P&gt;sure this is why &lt;CODE&gt;chart&lt;/CODE&gt;does not aggregate like &lt;CODE&gt;timechart&lt;/CODE&gt; does and as another pointer, did your try other formats for your chart? You can also change the behavior of the lines for example no results (connect, treat as zero ...)&lt;/P&gt;</description>
      <pubDate>Thu, 11 Dec 2014 17:05:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-CPU-Usage/m-p/156954#M44167</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-12-11T17:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: Average CPU Usage</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-CPU-Usage/m-p/156955#M44168</link>
      <description>&lt;P&gt;you can link any picture web page like tiny url, no need to upload a picture &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Dec 2014 17:06:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-CPU-Usage/m-p/156955#M44168</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-12-11T17:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: Average CPU Usage</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-CPU-Usage/m-p/156956#M44169</link>
      <description>&lt;P&gt;Almost there I think.  &lt;/P&gt;

&lt;P&gt;So, I adjusted the visualization (format, connect the dots basically), but it's weird as there is what looks to be a true CPU metric followed by a very low, inaccurate metric which makes the trend line extremely spiky and doesn't really resemble what the CPU is doing.&lt;/P&gt;

&lt;P&gt;So, the search is pretty simple - index=perfstats host=eivc201vwin | chart avg("%_Processor_Time") over _time by host&lt;/P&gt;

&lt;P&gt;This image shows how spiky the trend  line is - &lt;A href="http://pasteboard.co/2mtXDwFl.png" target="_blank"&gt;http://pasteboard.co/2mtXDwFl.png&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;This image shows the actual sample data where you see this "piggy back" type metric - &lt;A href="http://pbrd.co/16bamV9" target="_blank"&gt;http://pbrd.co/16bamV9&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You'll see a reading of say 45 followed immediately by a real low reading of 3.&lt;/P&gt;

&lt;P&gt;Thanks again for your time!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:25:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-CPU-Usage/m-p/156956#M44169</guid>
      <dc:creator>mark_chuman</dc:creator>
      <dc:date>2020-09-28T18:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: Average CPU Usage</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-CPU-Usage/m-p/156957#M44170</link>
      <description>&lt;P&gt;You're running the script to get the cpu stats every 5min right? Your spiky graph caused by this if you decrease the interval and get more results the smoother the graph will be &lt;/P&gt;</description>
      <pubDate>Thu, 11 Dec 2014 18:16:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-CPU-Usage/m-p/156957#M44170</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-12-11T18:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: Average CPU Usage</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-CPU-Usage/m-p/156958#M44171</link>
      <description>&lt;P&gt;It is grabbing the stats every 5 minutes, but it's weird as there are two stats for every 5 minute pull.  They are a second apart and these are the metrics that appear to be making the trend spiky as the second metric is always much lower than the first.  For example, a metric comes in at say 9:01:25 for 45% (or 45.87326) and then a metric comes in at 9:01:26 for say 2% (or 2.34344) and then the cycle starts again at 9:06:25.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Dec 2014 14:16:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-CPU-Usage/m-p/156958#M44171</guid>
      <dc:creator>mark_chuman</dc:creator>
      <dc:date>2014-12-15T14:16:31Z</dc:date>
    </item>
  </channel>
</rss>

