<?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: What is the difference between sma and avg? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-difference-between-sma-and-avg/m-p/219594#M64527</link>
    <description>&lt;P&gt;The sma is available in trendline. Here is documentation on Trendline&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/6.4.2/SearchReference/Trendline"&gt;https://docs.splunk.com/Documentation/Splunk/6.4.2/SearchReference/Trendline&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Aug 2016 14:28:56 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2016-08-09T14:28:56Z</dc:date>
    <item>
      <title>What is the difference between sma and avg?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-difference-between-sma-and-avg/m-p/219591#M64524</link>
      <description>&lt;P&gt;I want to know the exact difference between sma and avg.  Also, can someone pls provide detailed description of trendline?&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2016 11:16:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-difference-between-sma-and-avg/m-p/219591#M64524</guid>
      <dc:creator>simona2121</dc:creator>
      <dc:date>2016-08-09T11:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: What is the difference between sma and avg?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-difference-between-sma-and-avg/m-p/219592#M64525</link>
      <description>&lt;P&gt;The simple moving average (SMA) is the most basic of the moving averages used for stock/futures trading usually. The simple moving average formula is calculated by taking the average closing price of a stock over the last "x" periods.  (x@noon+x@1pm+x@2pm)/3&lt;/P&gt;

&lt;P&gt;Average (AVG) is the sum of all the parts divided by the number of the parts (x+y+z)/3&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2016 14:10:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-difference-between-sma-and-avg/m-p/219592#M64525</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-08-09T14:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: What is the difference between sma and avg?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-difference-between-sma-and-avg/m-p/219593#M64526</link>
      <description>&lt;P&gt;index=_internal | timechart count | trendline sma5(count)&lt;/P&gt;

&lt;P&gt;The number after sma is the number of buckets you want to average over.&lt;/P&gt;

&lt;P&gt;So sma5(count) averages the last 5 occurrences of count, whereas avg(count) would only be the average number of count in that time bucket.&lt;/P&gt;

&lt;P&gt;Say you have a field called sales, and these are your events:&lt;/P&gt;

&lt;P&gt;8/8 - sales=100&lt;BR /&gt;
8/8 - sales=50&lt;BR /&gt;
8/8 - sales=100&lt;BR /&gt;
8/8 - sales=50&lt;BR /&gt;
8/9 - sales=200&lt;BR /&gt;
8/9 - sales=100&lt;BR /&gt;
8/9 - sales=200&lt;BR /&gt;
8/9 - sales=100&lt;/P&gt;

&lt;P&gt;The avg(sales) on 8/8 is 75, the avg(sales) on 8/9 is 150, the sma2(sales) is 112.5 on 8/9 but it wont even compute for 8/8 because you only have 1 day of trailing data with sales and you wanted sma2. AND this is assuming you put your data in buckets which equal 1 day of time each... if you add timestamps for hours, timechart would then change to different bucket sizes.  You can force bucket sizes with the bin or bucket commands.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/6.4.2/SearchReference/Trendline"&gt;https://docs.splunk.com/Documentation/Splunk/6.4.2/SearchReference/Trendline&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.4.2/SearchReference/Bin"&gt;http://docs.splunk.com/Documentation/Splunk/6.4.2/SearchReference/Bin&lt;/A&gt;&lt;BR /&gt;
bucket is alias of bin&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2016 14:23:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-difference-between-sma-and-avg/m-p/219593#M64526</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-08-09T14:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: What is the difference between sma and avg?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-difference-between-sma-and-avg/m-p/219594#M64527</link>
      <description>&lt;P&gt;The sma is available in trendline. Here is documentation on Trendline&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/6.4.2/SearchReference/Trendline"&gt;https://docs.splunk.com/Documentation/Splunk/6.4.2/SearchReference/Trendline&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2016 14:28:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-difference-between-sma-and-avg/m-p/219594#M64527</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-08-09T14:28:56Z</dc:date>
    </item>
  </channel>
</rss>

