<?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: Stats into timechart in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Stats-into-timechart/m-p/196342#M56618</link>
    <description>&lt;P&gt;agreed. I had a similar issue also resolved by eventstats&lt;/P&gt;</description>
    <pubDate>Tue, 01 Aug 2017 18:01:14 GMT</pubDate>
    <dc:creator>gordo32</dc:creator>
    <dc:date>2017-08-01T18:01:14Z</dc:date>
    <item>
      <title>Stats into timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-into-timechart/m-p/196338#M56614</link>
      <description>&lt;P&gt;I'm running a query for a 1 hour window.  I need to group events by a unique ID and categorize them based on another field.  I can do this with the transaction and timechart command although its very slow.&lt;BR /&gt;
&lt;CODE&gt;transaction keepevicted=true UniqueID | timechart span="5m" limit=10 avg(duration) by myTypes&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I'm trying to reproduce this output using stats but I need the data broken down into 5 minute intervals for each type of transactions.  Here is what I have now that contains the final data I need. &lt;CODE&gt;stats range(_time) as UniqueID_Durations first(_time) by myTypes UniqueID&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I want to split this into a timechart using the first(_time) and have the time chart caclulate the average UniqueID_Duration for each myTypes.&lt;/P&gt;

&lt;P&gt;I feel like it should be this, but it does not work.&lt;BR /&gt;&lt;BR /&gt;
    &lt;CODE&gt;stats range(_time) as UniqueID_Duration first(_time) by myTypes UniqueID |  timechart span=5m avg(UniqueID_Duration) by myTypes&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Any suggestions?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Mar 2014 14:26:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-into-timechart/m-p/196338#M56614</guid>
      <dc:creator>wormfishin</dc:creator>
      <dc:date>2014-03-20T14:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: Stats into timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-into-timechart/m-p/196339#M56615</link>
      <description>&lt;P&gt;Hi wormfishin,&lt;/P&gt;

&lt;P&gt;the &lt;CODE&gt;timechart&lt;/CODE&gt; command uses &lt;CODE&gt;_time&lt;/CODE&gt; of your event which is not available anymore after your &lt;CODE&gt;stats&lt;/CODE&gt;. You could try something like this :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;stats range(_time) as UniqueID_Duration first(_time) as myTime by myTypes UniqueID | chart span=5m avg(UniqueID_Duration) over myTime by myTypes
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this is un-tested, but should work....&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Thu, 20 Mar 2014 14:31:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-into-timechart/m-p/196339#M56615</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-03-20T14:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: Stats into timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-into-timechart/m-p/196340#M56616</link>
      <description>&lt;P&gt;or simply use &lt;CODE&gt;eventstats&lt;/CODE&gt; instead of &lt;CODE&gt;stats&lt;/CODE&gt; and &lt;CODE&gt;_time&lt;/CODE&gt; will stay in your results &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Mar 2014 14:36:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-into-timechart/m-p/196340#M56616</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-03-20T14:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Stats into timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-into-timechart/m-p/196341#M56617</link>
      <description>&lt;P&gt;eventstats actually worked better as it displayed the time in string format instead of epoch.  Thanks, that was exactly what I needed.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Mar 2014 15:08:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-into-timechart/m-p/196341#M56617</guid>
      <dc:creator>wormfishin</dc:creator>
      <dc:date>2014-03-20T15:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: Stats into timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-into-timechart/m-p/196342#M56618</link>
      <description>&lt;P&gt;agreed. I had a similar issue also resolved by eventstats&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 18:01:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-into-timechart/m-p/196342#M56618</guid>
      <dc:creator>gordo32</dc:creator>
      <dc:date>2017-08-01T18:01:14Z</dc:date>
    </item>
  </channel>
</rss>

