<?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: Daily averages in usage over 7 days or similar... in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Daily-averages-in-usage-over-7-days-or-similar/m-p/426523#M170715</link>
    <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal source="*license_usage.log*" type=Usage idx IN (index1,index2,index3, index4,etcindex) 
 | eval yearmonthday=strftime(_time, "%m-%d-%Y") 
 | stats sum(eval(round(b/1024/1024/1024,4))) AS volume_gb by idx yearmonthday 
 | appendpipe [| stats avg(volume_gb) as volume_gb by idx | eval yearmonthday="ZZZZ" ]
 | chart sum(volume_gb) over idx by yearmonthday 
 | sort -ZZZZ | rename "ZZZZ" as "Average GB"
 | addcoltotals labelfield=idx
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 18 Jun 2019 14:14:32 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2019-06-18T14:14:32Z</dc:date>
    <item>
      <title>Daily averages in usage over 7 days or similar...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Daily-averages-in-usage-over-7-days-or-similar/m-p/426521#M170713</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index=_internal source="*license_usage.log*" type=Usage idx IN (index1,index2,index3, index4,etcindex) 
| eval yearmonthday=strftime(_time, "%m-%d-%Y") 
| stats sum(eval(round(b/1024/1024/1024,4))) AS volume_gb by idx yearmonthday 
| chart sum(volume_gb) over idx by yearmonthday | addtotals col=true fieldname="Total GB" labelfield=idx
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above works great  showing me my daily index usage (have it set for the previous 7 full days)&lt;/P&gt;

&lt;P&gt;But I would much rather print the row total as averages instead of totals while keeping the column totals.  Any idea?  Additionally, how can I sort this by average size descending but keeping the total row at the bottom?&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jun 2019 18:53:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Daily-averages-in-usage-over-7-days-or-similar/m-p/426521#M170713</guid>
      <dc:creator>antb</dc:creator>
      <dc:date>2019-06-15T18:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: Daily averages in usage over 7 days or similar...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Daily-averages-in-usage-over-7-days-or-similar/m-p/426522#M170714</link>
      <description>&lt;P&gt;Hello @antb,&lt;/P&gt;

&lt;P&gt;Please add below query at the end of your current search instead of using  &lt;CODE&gt;addtotals&lt;/CODE&gt; command.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| appendpipe [| stats avg(*) as * | eval idx="Avg usage"]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps!!!&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 14:11:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Daily-averages-in-usage-over-7-days-or-similar/m-p/426522#M170714</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2019-06-18T14:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: Daily averages in usage over 7 days or similar...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Daily-averages-in-usage-over-7-days-or-similar/m-p/426523#M170715</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal source="*license_usage.log*" type=Usage idx IN (index1,index2,index3, index4,etcindex) 
 | eval yearmonthday=strftime(_time, "%m-%d-%Y") 
 | stats sum(eval(round(b/1024/1024/1024,4))) AS volume_gb by idx yearmonthday 
 | appendpipe [| stats avg(volume_gb) as volume_gb by idx | eval yearmonthday="ZZZZ" ]
 | chart sum(volume_gb) over idx by yearmonthday 
 | sort -ZZZZ | rename "ZZZZ" as "Average GB"
 | addcoltotals labelfield=idx
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Jun 2019 14:14:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Daily-averages-in-usage-over-7-days-or-similar/m-p/426523#M170715</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2019-06-18T14:14:32Z</dc:date>
    </item>
  </channel>
</rss>

