<?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: Average duration in Timechart in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Average-duration-in-Timechart/m-p/549355#M155872</link>
    <description>&lt;P&gt;stats will reduce your pipeline of events to min_t, max_t and uniqueId - there is no _time field remaining in the events, so timechart has nothing to work with (timechart expects _time to be present in the events). You should probably select one of the times to be used for _time&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index= ... 
| stats min(_time) as min_t max(_time) as _time by uniqueId
| eval duration = (_time - min_t)* 1000
| timechart span=24h avg(duration) as AvgDur&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Apr 2021 16:16:29 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2021-04-26T16:16:29Z</dc:date>
    <item>
      <title>Average duration in Timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-duration-in-Timechart/m-p/549343#M155867</link>
      <description>&lt;P&gt;Hello, new to Splunk and would appreciate some guidance.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create a timechart query to use for a dashboard to display the average response time over 24h as a trend. This is what I have so far:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index= ... 
| stats min(_time) as min_t max(_time) as max_t by uniqueId
| eval duration = (max_t - min_t)* 1000
| timechart span=24h avg(duration) as AvgDur&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This returns an empty table as a response with no average duration values. If I return just before the timechart command, I get a table with all my log responses with the correct duration.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could I get some guidance on why timechart isn't returning the average durations over 24h?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 14:29:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-duration-in-Timechart/m-p/549343#M155867</guid>
      <dc:creator>cclva</dc:creator>
      <dc:date>2021-04-26T14:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: Average duration in Timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-duration-in-Timechart/m-p/549355#M155872</link>
      <description>&lt;P&gt;stats will reduce your pipeline of events to min_t, max_t and uniqueId - there is no _time field remaining in the events, so timechart has nothing to work with (timechart expects _time to be present in the events). You should probably select one of the times to be used for _time&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index= ... 
| stats min(_time) as min_t max(_time) as _time by uniqueId
| eval duration = (_time - min_t)* 1000
| timechart span=24h avg(duration) as AvgDur&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 16:16:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-duration-in-Timechart/m-p/549355#M155872</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-04-26T16:16:29Z</dc:date>
    </item>
  </channel>
</rss>

