<?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: Transaction or bucket not working for TOP command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Transaction-or-bucket-not-working-for-TOP-command/m-p/71664#M17901</link>
    <description>&lt;P&gt;Try this, it will be much more efficient than the &lt;CODE&gt;transaction&lt;/CODE&gt; command and work just as well&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=MyIndexers sourcetype=top 
| multikv fields USER PID PSR pctCPU CPUTIME pctMEM RSZ_KB VSZ_KB TTY s ELAPSED COMMAND ARGS 
| search COMMAND=splunkd 
| stats sum(pctCPU) as totalPctCPU sum(pctMEM) as totalPctMEM by host _time
| eval totalPctCPU = totalPctCPU / 8
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can't draw both statistics at once though... so for just one of them:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=MyIndexers sourcetype=top 
| multikv fields USER PID PSR pctCPU CPUTIME pctMEM RSZ_KB VSZ_KB TTY s ELAPSED COMMAND ARGS 
| search COMMAND=splunkd 
| stats sum(pctCPU) as totalPctCPU by host _time
| eval totalPctCPU = totalPctCPU / 8
| timechart span=1m avg(totalPctCPU) as pctCPU by host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 24 Sep 2013 17:39:37 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2013-09-24T17:39:37Z</dc:date>
    <item>
      <title>Transaction or bucket not working for TOP command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-or-bucket-not-working-for-TOP-command/m-p/71663#M17900</link>
      <description>&lt;P&gt;I am using the top command to see splunkd resource use just like SOS&lt;/P&gt;

&lt;P&gt;I would like to see the total CPU and MEMORY use for Splunkd but there are several PID numbers for splunkd.&lt;/P&gt;

&lt;P&gt;I can user the transaction command like this&lt;BR /&gt;
&lt;CODE&gt;host=MyIndexers sourcetype=top | multikv fields USER PID PSR pctCPU CPUTIME pctMEM RSZ_KB VSZ_KB TTY s ELAPSED COMMAND ARGS | search COMMAND=splunkd | transaction _time | timechart span=1m sum(pctCPU) by host&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;The problem is this isn't too accurate and the timechart span=1m could contain two or no results depending on the sync.&lt;/P&gt;

&lt;P&gt;I would also like to device the sum(pctCPU by 8 since I have 8 cores in each box.  this would give me an Percent of 100% rather than Percentage of 800%&lt;/P&gt;

&lt;P&gt;Any help would be appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2013 17:29:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-or-bucket-not-working-for-TOP-command/m-p/71663#M17900</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2013-09-24T17:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction or bucket not working for TOP command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-or-bucket-not-working-for-TOP-command/m-p/71664#M17901</link>
      <description>&lt;P&gt;Try this, it will be much more efficient than the &lt;CODE&gt;transaction&lt;/CODE&gt; command and work just as well&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=MyIndexers sourcetype=top 
| multikv fields USER PID PSR pctCPU CPUTIME pctMEM RSZ_KB VSZ_KB TTY s ELAPSED COMMAND ARGS 
| search COMMAND=splunkd 
| stats sum(pctCPU) as totalPctCPU sum(pctMEM) as totalPctMEM by host _time
| eval totalPctCPU = totalPctCPU / 8
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can't draw both statistics at once though... so for just one of them:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=MyIndexers sourcetype=top 
| multikv fields USER PID PSR pctCPU CPUTIME pctMEM RSZ_KB VSZ_KB TTY s ELAPSED COMMAND ARGS 
| search COMMAND=splunkd 
| stats sum(pctCPU) as totalPctCPU by host _time
| eval totalPctCPU = totalPctCPU / 8
| timechart span=1m avg(totalPctCPU) as pctCPU by host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Sep 2013 17:39:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-or-bucket-not-working-for-TOP-command/m-p/71664#M17901</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-09-24T17:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction or bucket not working for TOP command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-or-bucket-not-working-for-TOP-command/m-p/71665#M17902</link>
      <description>&lt;P&gt;This is exactly what I needed thank for both options.&lt;/P&gt;

&lt;P&gt;One question if you don't mind.  If there is no value I would like to have the value for the "pctCPU" for each server to be 0 this will insure a place holder oven if the CPU for SPlunkd drops to zero.  Can you help with that?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2013 17:48:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-or-bucket-not-working-for-TOP-command/m-p/71665#M17902</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2013-09-24T17:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction or bucket not working for TOP command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-or-bucket-not-working-for-TOP-command/m-p/71666#M17903</link>
      <description>&lt;P&gt;The &lt;CODE&gt;timechart&lt;/CODE&gt; command computes statistics for every interval, even if there are no events. You could look at the chart or the table.&lt;/P&gt;

&lt;P&gt;The &lt;CODE&gt;stats&lt;/CODE&gt; command doesn't do that. I can't think of a way to generate the 0 rows in the table for &lt;CODE&gt;stats&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2013 18:16:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-or-bucket-not-working-for-TOP-command/m-p/71666#M17903</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-09-24T18:16:04Z</dc:date>
    </item>
  </channel>
</rss>

