<?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 How to fetch relative fields out of timechart result based on Max(column) ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-relative-fields-out-of-timechart-result-based-on/m-p/444124#M168948</link>
    <description>&lt;P&gt;I have requirement where in i have to display in a timerange, what is the peak number of request per min and corresponding max response time during that min&lt;/P&gt;

&lt;P&gt;Below is the query which gives me the for a span 1 min what was the count of thread and max response time for the selected timerange&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=test, index=prod | timechart  count(R) as ThreadCount, max(response_time) as ResponseTime by host_type
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In above result i would like to get what was the peak numbr of request the host_type was able to handle and what was the maximum response time when it was handling the peak request. something similar to below, &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=test, index=prod | timechart  count(R) as ThreadCount, max(response_time) as ResponseTime by host_type|streamstats max(ThreadCount) as MaxThreadCount by host_type|sort +ThreadCount |stats first(ResponseTime) as CorrespondingResponseTime |where ThreadCount=MaxThreadCount|table MaxThreadCount, CorrespondingResponseTime
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am pretty sure something wrong in my query. Could you please help me in getting the peak number of request the host_type was able to handle and what was the maximum response time when it was handling the peak request.&lt;/P&gt;</description>
    <pubDate>Tue, 12 Jun 2018 08:40:47 GMT</pubDate>
    <dc:creator>sangs8788</dc:creator>
    <dc:date>2018-06-12T08:40:47Z</dc:date>
    <item>
      <title>How to fetch relative fields out of timechart result based on Max(column) ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-relative-fields-out-of-timechart-result-based-on/m-p/444124#M168948</link>
      <description>&lt;P&gt;I have requirement where in i have to display in a timerange, what is the peak number of request per min and corresponding max response time during that min&lt;/P&gt;

&lt;P&gt;Below is the query which gives me the for a span 1 min what was the count of thread and max response time for the selected timerange&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=test, index=prod | timechart  count(R) as ThreadCount, max(response_time) as ResponseTime by host_type
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In above result i would like to get what was the peak numbr of request the host_type was able to handle and what was the maximum response time when it was handling the peak request. something similar to below, &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=test, index=prod | timechart  count(R) as ThreadCount, max(response_time) as ResponseTime by host_type|streamstats max(ThreadCount) as MaxThreadCount by host_type|sort +ThreadCount |stats first(ResponseTime) as CorrespondingResponseTime |where ThreadCount=MaxThreadCount|table MaxThreadCount, CorrespondingResponseTime
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am pretty sure something wrong in my query. Could you please help me in getting the peak number of request the host_type was able to handle and what was the maximum response time when it was handling the peak request.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2018 08:40:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-relative-fields-out-of-timechart-result-based-on/m-p/444124#M168948</guid>
      <dc:creator>sangs8788</dc:creator>
      <dc:date>2018-06-12T08:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to fetch relative fields out of timechart result based on Max(column) ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-relative-fields-out-of-timechart-result-based-on/m-p/444125#M168949</link>
      <description>&lt;P&gt;Could you please provide the log and output sample you need for our better understanding&lt;/P&gt;

&lt;P&gt;Also please try this query. i dont know whether its your requirement&lt;BR /&gt;
host=test, index=prod | timechart count(R) as ThreadCount, max(response_time) as ResponseTime by host_type&lt;BR /&gt;
| appendcols  [ search host=test, index=prod | timechart  count(R) as ThreadCount,max(ThreadCount) as MaxThreadCount by host_type ] | table ThreadCount ResponseTime MaxThreadCount&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:58:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-relative-fields-out-of-timechart-result-based-on/m-p/444125#M168949</guid>
      <dc:creator>logloganathan</dc:creator>
      <dc:date>2020-09-29T19:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to fetch relative fields out of timechart result based on Max(column) ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-relative-fields-out-of-timechart-result-based-on/m-p/444126#M168950</link>
      <description>&lt;P&gt;This is what you asked for &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; host=test, index=prod 
| bin _time span=1m
| stats count(R) as ThreadCount, max(response_time) as ResponseTime by host_type _time
| eventstats max(ThreadCount) as MaxThreadCount by host_type
| where ThreadCount = MaxThreadCount
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, I'd probably do something more like this...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; host=test, index=prod 
| bin _time span=1m
| stats count(R) as ThreadCount, max(response_time) as ResponseMax avg(response_time) as ResponseAvg by host_type _time
| eventstats perc90(ThreadCount) as p90Count by host_type
| where ThreadCount&amp;gt;=p90Count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then, you can chew that up in various ways based upon what the shape of the results are.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2018 23:07:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-relative-fields-out-of-timechart-result-based-on/m-p/444126#M168950</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-06-12T23:07:33Z</dc:date>
    </item>
  </channel>
</rss>

