<?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 change my stats avg(x) search to an hourly timechart ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-my-stats-avg-x-search-to-an-hourly-timechart/m-p/267601#M80504</link>
    <description>&lt;P&gt;Thanks Martin both searches worked great my mistake.&lt;/P&gt;</description>
    <pubDate>Thu, 08 Oct 2015 21:04:33 GMT</pubDate>
    <dc:creator>pavanae</dc:creator>
    <dc:date>2015-10-08T21:04:33Z</dc:date>
    <item>
      <title>How to change my stats avg(x) search to an hourly timechart ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-my-stats-avg-x-search-to-an-hourly-timechart/m-p/267596#M80499</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;I have the following search which displays the Average of a field, but I am trying to put a time chart in hourly which shows the average of that particular hour.&lt;/P&gt;

&lt;P&gt;…..My Search……|rex "&amp;lt;Total_Amount_Due&amp;gt;(?&amp;lt;amount&amp;gt;\d+.\d+)&amp;lt;/Total_Amount_Due&amp;gt;" | stats count by amount | where amount &amp;gt; 0 | stats avg(amount) as average&lt;BR /&gt;
How to modify my search to display the hourly average count?&lt;/P&gt;

&lt;P&gt;Any help or Suggestions?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:32:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-my-stats-avg-x-search-to-an-hourly-timechart/m-p/267596#M80499</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2020-09-29T07:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to change my stats avg(x) search to an hourly timechart ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-my-stats-avg-x-search-to-an-hourly-timechart/m-p/267597#M80500</link>
      <description>&lt;P&gt;You could use this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex ... | timechart span=1h count dc(amount) as dc | eval average = count / dc | fields - count dc
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will count the events per hour and the number of different &lt;CODE&gt;amount&lt;/CODE&gt; values to then compute the average.&lt;/P&gt;

&lt;P&gt;Alternatively, you could do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex ... | bin span=1h _time | stats count by _time amount | timechart span=1h avg(count) as average
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note, I've changed &lt;CODE&gt;avg(amount)&lt;/CODE&gt; to &lt;CODE&gt;avg(count)&lt;/CODE&gt;, not sure if that was intentional in your question or not.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2015 19:34:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-my-stats-avg-x-search-to-an-hourly-timechart/m-p/267597#M80500</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-10-08T19:34:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to change my stats avg(x) search to an hourly timechart ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-my-stats-avg-x-search-to-an-hourly-timechart/m-p/267598#M80501</link>
      <description>&lt;P&gt;Hi everything seems good but it was giving the wrong average. &lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2015 20:04:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-my-stats-avg-x-search-to-an-hourly-timechart/m-p/267598#M80501</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2015-10-08T20:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to change my stats avg(x) search to an hourly timechart ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-my-stats-avg-x-search-to-an-hourly-timechart/m-p/267599#M80502</link>
      <description>&lt;P&gt;Try to use Martin's 2nd query with avg(amount) in the timechart.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2015 20:43:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-my-stats-avg-x-search-to-an-hourly-timechart/m-p/267599#M80502</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-10-08T20:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to change my stats avg(x) search to an hourly timechart ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-my-stats-avg-x-search-to-an-hourly-timechart/m-p/267600#M80503</link>
      <description>&lt;P&gt;If both don't produce results you like then please do post sample data along with intended results.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2015 20:46:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-my-stats-avg-x-search-to-an-hourly-timechart/m-p/267600#M80503</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-10-08T20:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to change my stats avg(x) search to an hourly timechart ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-my-stats-avg-x-search-to-an-hourly-timechart/m-p/267601#M80504</link>
      <description>&lt;P&gt;Thanks Martin both searches worked great my mistake.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2015 21:04:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-my-stats-avg-x-search-to-an-hourly-timechart/m-p/267601#M80504</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2015-10-08T21:04:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to change my stats avg(x) search to an hourly timechart ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-my-stats-avg-x-search-to-an-hourly-timechart/m-p/267602#M80505</link>
      <description>&lt;P&gt;It sounds like all you want is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... My Search ...|rex "&amp;lt;Total_Amount_Due&amp;gt;(?&amp;lt;amount&amp;gt;\d+.\d+)&amp;lt;/Total_Amount_Due&amp;gt;" | timechart span=1h avg(amount)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Oct 2016 09:54:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-my-stats-avg-x-search-to-an-hourly-timechart/m-p/267602#M80505</guid>
      <dc:creator>tedwroks</dc:creator>
      <dc:date>2016-10-20T09:54:58Z</dc:date>
    </item>
  </channel>
</rss>

