<?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 get the TPS of all events in a 24 hours by host . in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-TPS-of-all-events-in-a-24-hours-by-host/m-p/348886#M103273</link>
    <description>&lt;P&gt;For First part you can use like this (Max(TPS) in each hour of 24 hours )&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | tstats count as tps WHERE index= xyz host=yxs sourcetype=jhj  by _time span=1s 
 | timechart span=1h max(tps) as maxTPS
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm not sure I understood the second part. Do you want to add a field say Result which will compare Hourly maxTPS with overall maxTPS for last 24 hrs? If so, try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | tstats count as tps WHERE index= xyz host=yxs sourcetype=jhj  by _time span=1s 
 | timechart span=1h max(tps) as maxTPS  | eventstats max(maxTPS) as peakTPSDay
 | eval Result=case(maxTPS&amp;lt;peakTPSDay, "Over",maxTPS&amp;gt;peakTPSDay, "Under",1=1,"Same")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;you can replace max(maxTPS) with avg as well if that interests you.&lt;/P&gt;</description>
    <pubDate>Thu, 09 Mar 2017 02:26:03 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2017-03-09T02:26:03Z</dc:date>
    <item>
      <title>How to get the TPS of all events in a 24 hours by host .</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-TPS-of-all-events-in-a-24-hours-by-host/m-p/348877#M103264</link>
      <description>&lt;P&gt;We are trying to get TPS for 3 diff hosts and ,need to be able to see the peak transactions for a given period. initially i did test with one host using below query for 15 mins , which is fine . But I need to check the peak transactions per second for 24 hours , which yields 9 lac records and only 1000 events are displayed in TPS Line  graphe&lt;BR /&gt;
and rest are truncated . &lt;/P&gt;

&lt;P&gt;Help needed to finetune a query which can achieve the peak transactions for a given period&lt;/P&gt;

&lt;P&gt;basesearch | timechart span=1s count as TPS  .&lt;/P&gt;

&lt;P&gt;basesearch | | timechart span=1s count as TPS |eventstats max(TPS) as PeakTPS&lt;/P&gt;

&lt;P&gt;basesearch  | bucket span=1s _time | stats count(TPS)  by _time host | timechart max(TPS) as Peak -- no results - by adding host &lt;/P&gt;

&lt;P&gt;I did search all the answers related to TPS , but couldn't help in achieving the my req.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 19:13:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-TPS-of-all-events-in-a-24-hours-by-host/m-p/348877#M103264</guid>
      <dc:creator>guru865</dc:creator>
      <dc:date>2017-03-08T19:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the TPS of all events in a 24 hours by host .</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-TPS-of-all-events-in-a-24-hours-by-host/m-p/348878#M103265</link>
      <description>&lt;P&gt;Does you base search only rely on metadata / indexed fields (e.g., index, source, sourcetype, and host)? If so, you should get much better performance using &lt;CODE&gt;tstats&lt;/CODE&gt;, e.g.,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count where index=&amp;lt;insert index&amp;gt; by host _time span=1s
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Mar 2017 19:23:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-TPS-of-all-events-in-a-24-hours-by-host/m-p/348878#M103265</guid>
      <dc:creator>rjthibod</dc:creator>
      <dc:date>2017-03-08T19:23:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the TPS of all events in a 24 hours by host .</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-TPS-of-all-events-in-a-24-hours-by-host/m-p/348879#M103266</link>
      <description>&lt;P&gt;rjthibod ,&lt;/P&gt;

&lt;P&gt;yes , my basesearch &lt;/P&gt;

&lt;P&gt;index= xyz host=yxs sourcetype=jhj |  tstats count where index= by host _time span=1s&lt;/P&gt;

&lt;P&gt;which gives an error :   " Error in 'tstats' command: This command must be the first command of a search."&lt;/P&gt;

&lt;P&gt;Thank you &lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 19:42:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-TPS-of-all-events-in-a-24-hours-by-host/m-p/348879#M103266</guid>
      <dc:creator>guru865</dc:creator>
      <dc:date>2017-03-08T19:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the TPS of all events in a 24 hours by host .</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-TPS-of-all-events-in-a-24-hours-by-host/m-p/348880#M103267</link>
      <description>&lt;P&gt;That is not how to correctly use &lt;CODE&gt;tstats&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;The base search would now become this&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| tstats count where index=xyz host=yxs sourcetype=jhj by _time span=1s&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;If you want to chart that you would need to use &lt;CODE&gt;prestats&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| tstats count where index=xyz host=yxs sourcetype=jhj by _time span=1s prestats=t | timechart span=1s fixedrange=f count as count&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 19:46:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-TPS-of-all-events-in-a-24-hours-by-host/m-p/348880#M103267</guid>
      <dc:creator>rjthibod</dc:creator>
      <dc:date>2017-03-08T19:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the TPS of all events in a 24 hours by host .</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-TPS-of-all-events-in-a-24-hours-by-host/m-p/348881#M103268</link>
      <description>&lt;P&gt;It's not absolutely necessary to use prestats in order to chart.  Prestats gives you some underlying information that allows splunk to re-compute things like averages.  If you just want to know and aggregate the number of transactions over time, you don't need that data.&lt;/P&gt;

&lt;P&gt;You DO have to make sure not to confuse splunk between the "count" output field of the tstats command and the "count" input field of the timechart command.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count as trancount where index=xyz host=yxs sourcetype=jhj by _time span=1s 
| timechart span=1s fixedrange=f sum(trancount) as count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Mar 2017 20:36:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-TPS-of-all-events-in-a-24-hours-by-host/m-p/348881#M103268</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-03-08T20:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the TPS of all events in a 24 hours by host .</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-TPS-of-all-events-in-a-24-hours-by-host/m-p/348882#M103269</link>
      <description>&lt;P&gt;Extending @rjthibod's solution, here is what you can use to find  peak tps value and corresponding time.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count as tps WHERE index= xyz host=yxs sourcetype=jhj  by _time span=1s 
| eventstats max(tps) as peakTPS | where tps=peakTPS
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR (get top 5 peaks)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count as tps WHERE index= xyz host=yxs sourcetype=jhj  by _time span=1s 
| sort 5 -tps
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Mar 2017 20:47:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-TPS-of-all-events-in-a-24-hours-by-host/m-p/348882#M103269</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-03-08T20:47:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the TPS of all events in a 24 hours by host .</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-TPS-of-all-events-in-a-24-hours-by-host/m-p/348883#M103270</link>
      <description>&lt;P&gt;Thanks as always for backing me up with even more useful queries.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 23:13:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-TPS-of-all-events-in-a-24-hours-by-host/m-p/348883#M103270</guid>
      <dc:creator>rjthibod</dc:creator>
      <dc:date>2017-03-08T23:13:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the TPS of all events in a 24 hours by host .</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-TPS-of-all-events-in-a-24-hours-by-host/m-p/348884#M103271</link>
      <description>&lt;P&gt;Thanks Soni for query of  peak tps value and corresponding time and top 5 tps .&lt;/P&gt;

&lt;P&gt;I'm looking for results of Max(TPS)  in each hour of 24 hours time range where span=1s &lt;BR /&gt;
and would like to schedule it to have results each individual hour against the 24 hr time range .&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2017 02:18:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-TPS-of-all-events-in-a-24-hours-by-host/m-p/348884#M103271</guid>
      <dc:creator>guru865</dc:creator>
      <dc:date>2017-03-09T02:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the TPS of all events in a 24 hours by host .</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-TPS-of-all-events-in-a-24-hours-by-host/m-p/348885#M103272</link>
      <description>&lt;P&gt;Thanks Rjthibod for quick turn around.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2017 02:19:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-TPS-of-all-events-in-a-24-hours-by-host/m-p/348885#M103272</guid>
      <dc:creator>guru865</dc:creator>
      <dc:date>2017-03-09T02:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the TPS of all events in a 24 hours by host .</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-TPS-of-all-events-in-a-24-hours-by-host/m-p/348886#M103273</link>
      <description>&lt;P&gt;For First part you can use like this (Max(TPS) in each hour of 24 hours )&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | tstats count as tps WHERE index= xyz host=yxs sourcetype=jhj  by _time span=1s 
 | timechart span=1h max(tps) as maxTPS
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm not sure I understood the second part. Do you want to add a field say Result which will compare Hourly maxTPS with overall maxTPS for last 24 hrs? If so, try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | tstats count as tps WHERE index= xyz host=yxs sourcetype=jhj  by _time span=1s 
 | timechart span=1h max(tps) as maxTPS  | eventstats max(maxTPS) as peakTPSDay
 | eval Result=case(maxTPS&amp;lt;peakTPSDay, "Over",maxTPS&amp;gt;peakTPSDay, "Under",1=1,"Same")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;you can replace max(maxTPS) with avg as well if that interests you.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2017 02:26:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-TPS-of-all-events-in-a-24-hours-by-host/m-p/348886#M103273</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-03-09T02:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the TPS of all events in a 24 hours by host .</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-TPS-of-all-events-in-a-24-hours-by-host/m-p/348887#M103274</link>
      <description>&lt;P&gt;Thanks Soni .&lt;BR /&gt;
yes I would like to have Max TPS for each hour in 24 hours time range .Initially , I was trying to achieve span=1s and have a "Line graphe to show " TPS for 24 hours . Since the search yields 10 lac plus events and Line graphe can only display 1000 events and truncate the rest .&lt;BR /&gt;
I did prefer to have MaxTPS for each hour in 24 hours time range .&lt;/P&gt;

&lt;P&gt;Thanks again for great help and You are a Pro!&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2017 03:02:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-TPS-of-all-events-in-a-24-hours-by-host/m-p/348887#M103274</guid>
      <dc:creator>guru865</dc:creator>
      <dc:date>2017-03-09T03:02:43Z</dc:date>
    </item>
  </channel>
</rss>

