<?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 compute an average duration of a group of session in a given time period in a single value with a trendline? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-compute-an-average-duration-of-a-group-of-session-in-a/m-p/327507#M21226</link>
    <description>&lt;P&gt;What you don't want to do is calculate the average of averages by slapping timechart on the end of your previously calculated average in stats. Try this instead.&lt;/P&gt;

&lt;P&gt;index=wholesale_app  CustomAnalytic Properties.index=30 OR Properties.index=21 buildTarget=* product=* |rename Properties.args as properties|stats min(_time) AS earliest max(_time) AS latest by clientSessionId | eval duration=latest-earliest, _time=latest | timechart avg(duration) as adur&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 17:48:23 GMT</pubDate>
    <dc:creator>davpx</dc:creator>
    <dc:date>2020-09-29T17:48:23Z</dc:date>
    <item>
      <title>How to compute an average duration of a group of session in a given time period in a single value with a trendline?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-compute-an-average-duration-of-a-group-of-session-in-a/m-p/327506#M21225</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have the below query the computes an average duration of a group of session in a given time period&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wholesale_app  CustomAnalytic Properties.index=30 OR Properties.index=21 buildTarget=* product=* |rename Properties.args as properties|stats min(_time) AS earliest max(_time) AS latest by clientSessionId | eval duration=latest-earliest | stats avg(duration) as adur|eval adur=round(adur/60,2)|rename adur as "Average Duration"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It works just fine.  What I need to do is get it where there is a single value with a trendline.  I realize that you have to do that with the timechart command but no matter how I poke at this I can't seem to get it to work.&lt;/P&gt;

&lt;P&gt;Thoughts?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2018 22:07:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-compute-an-average-duration-of-a-group-of-session-in-a/m-p/327506#M21225</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2018-01-25T22:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to compute an average duration of a group of session in a given time period in a single value with a trendline?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-compute-an-average-duration-of-a-group-of-session-in-a/m-p/327507#M21226</link>
      <description>&lt;P&gt;What you don't want to do is calculate the average of averages by slapping timechart on the end of your previously calculated average in stats. Try this instead.&lt;/P&gt;

&lt;P&gt;index=wholesale_app  CustomAnalytic Properties.index=30 OR Properties.index=21 buildTarget=* product=* |rename Properties.args as properties|stats min(_time) AS earliest max(_time) AS latest by clientSessionId | eval duration=latest-earliest, _time=latest | timechart avg(duration) as adur&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:48:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-compute-an-average-duration-of-a-group-of-session-in-a/m-p/327507#M21226</guid>
      <dc:creator>davpx</dc:creator>
      <dc:date>2020-09-29T17:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to compute an average duration of a group of session in a given time period in a single value with a trendline?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-compute-an-average-duration-of-a-group-of-session-in-a/m-p/327508#M21227</link>
      <description>&lt;P&gt;Hi Davpx,&lt;/P&gt;

&lt;P&gt;Tried this (had to clean up a couple of things) but no luck (no results found)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wholesale_app CustomAnalytic Properties.index=30 OR Properties.index=21 buildTarget=* product=* |rename Properties.args as properties|stats min(_time) AS earliest max(_time) AS latest by clientSessionId | eval duration=latest-earliest | timechart avg(duration) as adur
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I think it is due to the fact that the stats line doesn't pass in the _time field, but I'm not sure how to make that happen.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2018 22:34:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-compute-an-average-duration-of-a-group-of-session-in-a/m-p/327508#M21227</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2018-01-25T22:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to compute an average duration of a group of session in a given time period in a single value with a trendline?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-compute-an-average-duration-of-a-group-of-session-in-a/m-p/327509#M21228</link>
      <description>&lt;P&gt;I think you missed a part. Be sure to pass _time through with this&lt;/P&gt;

&lt;P&gt;| eval duration=latest-earliest, &lt;STRONG&gt;_time=latest&lt;/STRONG&gt; | timechart avg(duration) as adur&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2018 22:36:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-compute-an-average-duration-of-a-group-of-session-in-a/m-p/327509#M21228</guid>
      <dc:creator>davpx</dc:creator>
      <dc:date>2018-01-25T22:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to compute an average duration of a group of session in a given time period in a single value with a trendline?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-compute-an-average-duration-of-a-group-of-session-in-a/m-p/327510#M21229</link>
      <description>&lt;P&gt;I also tried this and it gave a value (it was a wrong value but it was a value)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wholesale_app CustomAnalytic Properties.index=30 OR Properties.index=21 buildTarget=* product=* |rename Properties.args as properties|stats min(_time) AS earliest max(_time) AS latest list(_time) as _time by clientSessionId | eval duration=latest-earliest | timechart span=1d avg(duration) as adur
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 Jan 2018 22:39:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-compute-an-average-duration-of-a-group-of-session-in-a/m-p/327510#M21229</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2018-01-25T22:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to compute an average duration of a group of session in a given time period in a single value with a trendline?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-compute-an-average-duration-of-a-group-of-session-in-a/m-p/327511#M21230</link>
      <description>&lt;P&gt;Whups sorry missed that, fixed and now....&lt;/P&gt;

&lt;P&gt;I now get a value, 60 but the original query gave me a value of 135&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2018 22:48:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-compute-an-average-duration-of-a-group-of-session-in-a/m-p/327511#M21230</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2018-01-25T22:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to compute an average duration of a group of session in a given time period in a single value with a trendline?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-compute-an-average-duration-of-a-group-of-session-in-a/m-p/327512#M21231</link>
      <description>&lt;P&gt;Just to confirm here is the updated query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wholesale_app CustomAnalytic Properties.index=30 OR Properties.index=21 buildTarget=* product=* |rename Properties.args as properties|stats min(_time) AS earliest max(_time) AS latest list(_time) as _time by clientSessionId | eval duration=latest-earliest,_time=latest |timechart span=1d avg(duration) as adur|
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 Jan 2018 22:49:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-compute-an-average-duration-of-a-group-of-session-in-a/m-p/327512#M21231</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2018-01-25T22:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to compute an average duration of a group of session in a given time period in a single value with a trendline?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-compute-an-average-duration-of-a-group-of-session-in-a/m-p/327513#M21232</link>
      <description>&lt;P&gt;index=wholesale_app CustomAnalytic Properties.index=30 OR Properties.index=21 buildTarget= product= |rename Properties.args as properties|stats min(_time) AS earliest max(_time) AS latest by clientSessionId | eval duration=latest-earliest, _time=latest | timechart avg(duration) as adur |eval adur=round(adur/60,2)&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:48:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-compute-an-average-duration-of-a-group-of-session-in-a/m-p/327513#M21232</guid>
      <dc:creator>davpx</dc:creator>
      <dc:date>2020-09-29T17:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to compute an average duration of a group of session in a given time period in a single value with a trendline?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-compute-an-average-duration-of-a-group-of-session-in-a/m-p/327514#M21233</link>
      <description>&lt;P&gt;I think that one is close.  Now that I'm looking at the data I'm thinking my original idea won't work but you gave me one that will, and maybe work even better &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;TKS!!!&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2018 23:02:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-compute-an-average-duration-of-a-group-of-session-in-a/m-p/327514#M21233</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2018-01-25T23:02:20Z</dc:date>
    </item>
  </channel>
</rss>

