<?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 can I show average, peak, and peak time in a single search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-show-average-peak-and-peak-time-in-a-single-search/m-p/230519#M68338</link>
    <description>&lt;P&gt;That worked!  Thanks for quick reply and solution.&lt;/P&gt;</description>
    <pubDate>Tue, 10 Nov 2015 13:52:13 GMT</pubDate>
    <dc:creator>wierling</dc:creator>
    <dc:date>2015-11-10T13:52:13Z</dc:date>
    <item>
      <title>How can I show average, peak, and peak time in a single search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-show-average-peak-and-peak-time-in-a-single-search/m-p/230517#M68336</link>
      <description>&lt;P&gt;Hi, my first post..I'm trying to display in a search the Average TPS (transactions per second), along with Peak TPS, along with timestamp that peak TPS occurred at in a 1 hour window.&lt;BR /&gt;
Example:&lt;BR /&gt;
AvgTPS | PeakTPS | PeakTime&lt;BR /&gt;
100 | 500 | 11:05:15&lt;/P&gt;

&lt;P&gt;I can get the values in separate searches, but can't seem to combine them into a single table result as above.&lt;/P&gt;

&lt;P&gt;Here is the search that gets Average and Peak TPS:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=test | timechart span=1m count(index) AS TPM | eval TPS=TPM/60 | stats avg(TPS) as avgTPS, max(TPS) as peakTPS
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here's the search that gets Peak TPS and Time peak occurred:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=test | timechart span=1m count(index) AS TPM | eval peakTPS=TPM/60 | table peakTPS _time | sort peakTPS desc | head 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How can I get the results in a single search?&lt;BR /&gt;
Thanks,&lt;BR /&gt;
-Bob&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2015 20:20:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-show-average-peak-and-peak-time-in-a-single-search/m-p/230517#M68336</guid>
      <dc:creator>wierling</dc:creator>
      <dc:date>2015-11-09T20:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: How can I show average, peak, and peak time in a single search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-show-average-peak-and-peak-time-in-a-single-search/m-p/230518#M68337</link>
      <description>&lt;P&gt;Try this!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=test 
| timechart span=1s count AS TPS
| eventstats max(TPS) as peakTPS
| eval peakTime=if(peakTPS==TPS,_time,null())
| stats avg(TPS) as avgTPS first(peakTPS) as peakTPS first(peakTime) as peakTime
| fieldformat peakTime=strftime(peakTime,"%x %X")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The eventstats command calculates the peakTPS and then the following eval command determines when that peakTPS occurred.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2015 21:39:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-show-average-peak-and-peak-time-in-a-single-search/m-p/230518#M68337</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2015-11-09T21:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: How can I show average, peak, and peak time in a single search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-show-average-peak-and-peak-time-in-a-single-search/m-p/230519#M68338</link>
      <description>&lt;P&gt;That worked!  Thanks for quick reply and solution.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Nov 2015 13:52:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-show-average-peak-and-peak-time-in-a-single-search/m-p/230519#M68338</guid>
      <dc:creator>wierling</dc:creator>
      <dc:date>2015-11-10T13:52:13Z</dc:date>
    </item>
  </channel>
</rss>

