<?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 calculate Max, Min, Avg for duration of a transaction? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-Max-Min-Avg-for-duration-of-a-transaction/m-p/378521#M110958</link>
    <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=YouShouldAlwaysSpecifyAnIndex AND sourcetype=AndSourcetypeToo AND host=* AND source="*/example.log" AND ("Model*" OR "Response*")
| transaction traceId startswith="Model" endswith="Response"
| eventstats min(duration) As min_dur max(duration) AS max_dur avg(duration) AS avg_dur
| rename duration AS time_taken
| fieldformat time_taken = tostring(duration,"duration")
| table traceId time_taken _time *_dur
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 03 Jul 2019 18:57:29 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2019-07-03T18:57:29Z</dc:date>
    <item>
      <title>How to calculate Max, Min, Avg for duration of a transaction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-Max-Min-Avg-for-duration-of-a-transaction/m-p/378520#M110957</link>
      <description>&lt;P&gt;I'm calculating the time difference between two events by using &lt;CODE&gt;Transaction&lt;/CODE&gt; and &lt;CODE&gt;Duration&lt;/CODE&gt;. Below is the query that I used to get the duration between two events &lt;CODE&gt;Model&lt;/CODE&gt; and &lt;CODE&gt;Response&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=* sourcetype=** source="*/example.log" "Model*" OR "Response*"
| transaction traceId startswith="Model" endswith="Response" | eval dur=duration
| eval time_taken=tostring(dur,"duration")  | table traceId time_taken _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And the result would be similar to &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;traceId          |      time_take      | _time
trace_1681692777 |   00:00:0.451        | 2019-07-03 15:52:02.537
trace_1681692779 |   00:00:1.921        | 2019-07-03 15:55:00.129
trace_1681692780 |   00:00:3.981        | 2019-07-03 15:59:01.754
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Using the above data, I want to get the max, min and avg &lt;CODE&gt;time_taken&lt;/CODE&gt; values. I tried using stats min(dur) as min, etc and eval but was not successful. How do I achieve this?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 18:50:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-Max-Min-Avg-for-duration-of-a-transaction/m-p/378520#M110957</guid>
      <dc:creator>amunag439</dc:creator>
      <dc:date>2019-07-03T18:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Max, Min, Avg for duration of a transaction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-Max-Min-Avg-for-duration-of-a-transaction/m-p/378521#M110958</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=YouShouldAlwaysSpecifyAnIndex AND sourcetype=AndSourcetypeToo AND host=* AND source="*/example.log" AND ("Model*" OR "Response*")
| transaction traceId startswith="Model" endswith="Response"
| eventstats min(duration) As min_dur max(duration) AS max_dur avg(duration) AS avg_dur
| rename duration AS time_taken
| fieldformat time_taken = tostring(duration,"duration")
| table traceId time_taken _time *_dur
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Jul 2019 18:57:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-Max-Min-Avg-for-duration-of-a-transaction/m-p/378521#M110958</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-07-03T18:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Max, Min, Avg for duration of a transaction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-Max-Min-Avg-for-duration-of-a-transaction/m-p/378522#M110959</link>
      <description>&lt;P&gt;Works like a charm. Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 19:32:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-Max-Min-Avg-for-duration-of-a-transaction/m-p/378522#M110959</guid>
      <dc:creator>amunag439</dc:creator>
      <dc:date>2019-07-03T19:32:08Z</dc:date>
    </item>
  </channel>
</rss>

