<?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 range(_time)  help ?? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/range-time-help/m-p/35745#M7857</link>
    <description>&lt;P&gt;I have bulk of 1 lakh events in my logs . I have used the stats(_range) command to calculate the average response time of all the transactions , but  then for few transactions i couldnt see the proper values coming .. i.e if i use the transcation command i am getting the desired results but its taking too much of time .. so i tried with stats range(_time) but its not getting correct results..&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Stats Query ::&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;index="apps" ("Request document" OR "Response document") | stats range(_time) as duration by Product&lt;/P&gt;

&lt;P&gt;This Query is not working i.e showing improper stats . so i have used the transaction query as below but its taking so much of time to execute.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Transaction Query ::&lt;/STRONG&gt; &lt;/P&gt;

&lt;P&gt;index="apps" ("Request document" OR "Response document") | stats avg(_time) as duration by Product&lt;/P&gt;

&lt;P&gt;Please help Or Suggest a better way to calucate the avg response time..i have huge amount of requests per hr say 1 lakh nd in need the stats for over 24 hrs period.&lt;/P&gt;

&lt;P&gt;index="apps" ("Request document" OR "Response document") | transaction keepevicted=true Product | table Product,duration&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 12:48:38 GMT</pubDate>
    <dc:creator>rakesh_498115</dc:creator>
    <dc:date>2020-09-28T12:48:38Z</dc:date>
    <item>
      <title>range(_time)  help ??</title>
      <link>https://community.splunk.com/t5/Splunk-Search/range-time-help/m-p/35745#M7857</link>
      <description>&lt;P&gt;I have bulk of 1 lakh events in my logs . I have used the stats(_range) command to calculate the average response time of all the transactions , but  then for few transactions i couldnt see the proper values coming .. i.e if i use the transcation command i am getting the desired results but its taking too much of time .. so i tried with stats range(_time) but its not getting correct results..&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Stats Query ::&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;index="apps" ("Request document" OR "Response document") | stats range(_time) as duration by Product&lt;/P&gt;

&lt;P&gt;This Query is not working i.e showing improper stats . so i have used the transaction query as below but its taking so much of time to execute.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Transaction Query ::&lt;/STRONG&gt; &lt;/P&gt;

&lt;P&gt;index="apps" ("Request document" OR "Response document") | stats avg(_time) as duration by Product&lt;/P&gt;

&lt;P&gt;Please help Or Suggest a better way to calucate the avg response time..i have huge amount of requests per hr say 1 lakh nd in need the stats for over 24 hrs period.&lt;/P&gt;

&lt;P&gt;index="apps" ("Request document" OR "Response document") | transaction keepevicted=true Product | table Product,duration&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:48:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/range-time-help/m-p/35745#M7857</guid>
      <dc:creator>rakesh_498115</dc:creator>
      <dc:date>2020-09-28T12:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: range(_time)  help ??</title>
      <link>https://community.splunk.com/t5/Splunk-Search/range-time-help/m-p/35746#M7858</link>
      <description>&lt;P&gt;A few things. First of all, what is "lakh" and "nd"?&lt;/P&gt;

&lt;P&gt;Secondly, it's no wonder that your stats query isn't working - you're taking an average value of the events' epoch timestamps, which is in no way related to durations. Judging by your transaction query that is reportedly working I don't see why you want an average value in your stats query? To get the duration by product, you could get the last _time value and subtract the first _time value from that.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats earliest(_time),latest(_time) by Product | eval duration=latest(_time)-earliest(_time) | table Product,duration
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Nov 2012 12:01:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/range-time-help/m-p/35746#M7858</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-11-15T12:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: range(_time)  help ??</title>
      <link>https://community.splunk.com/t5/Splunk-Search/range-time-help/m-p/35747#M7859</link>
      <description>&lt;P&gt;avg(_time) calculates the average of the event timestamps, not any kind of time delay.&lt;/P&gt;

&lt;P&gt;Assuming each Product has exactly one request and response event, you can compute the difference between the maximum and minimum _time to get the response time.&lt;/P&gt;

&lt;P&gt;Concerning the transaction run duration, you can fine-tune that by setting maxspan/maxpause.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2012 12:04:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/range-time-help/m-p/35747#M7859</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2012-11-15T12:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: range(_time)  help ??</title>
      <link>https://community.splunk.com/t5/Splunk-Search/range-time-help/m-p/35748#M7860</link>
      <description>&lt;P&gt;One lakh is 100000.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2012 12:05:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/range-time-help/m-p/35748#M7860</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2012-11-15T12:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: range(_time)  help ??</title>
      <link>https://community.splunk.com/t5/Splunk-Search/range-time-help/m-p/35749#M7861</link>
      <description>&lt;P&gt;Hi Ayn,&lt;/P&gt;

&lt;P&gt;Its not average actually , i need the time difference between the request and respone . so i have used range(_time) .. but this is not giving proper results .can you pls help me on this .&lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2012 07:41:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/range-time-help/m-p/35749#M7861</guid>
      <dc:creator>rakesh_498115</dc:creator>
      <dc:date>2012-11-16T07:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: range(_time)  help ??</title>
      <link>https://community.splunk.com/t5/Splunk-Search/range-time-help/m-p/35750#M7862</link>
      <description>&lt;P&gt;Ah yes, range would do it as well. I AM trying to help you, but I don't see any response to what I suggested. What's not working? What are expected results, and what are you in fact getting?&lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2012 08:22:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/range-time-help/m-p/35750#M7862</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-11-16T08:22:09Z</dc:date>
    </item>
    <item>
      <title>Re: range(_time)  help ??</title>
      <link>https://community.splunk.com/t5/Splunk-Search/range-time-help/m-p/35751#M7863</link>
      <description>&lt;P&gt;Even the mentioned query worked for me Ayn..thanx&lt;/P&gt;</description>
      <pubDate>Sat, 17 Nov 2012 13:46:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/range-time-help/m-p/35751#M7863</guid>
      <dc:creator>rakesh_498115</dc:creator>
      <dc:date>2012-11-17T13:46:23Z</dc:date>
    </item>
  </channel>
</rss>

