<?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 Weekly Value in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Average-Weekly-Value/m-p/104226#M26989</link>
    <description>&lt;P&gt;Something like "search=foo ... | stats command_to_get_daily_count | eval wnum=strftime(_time, "%V") | stats avg(count) by wnum"&lt;/P&gt;</description>
    <pubDate>Thu, 29 Mar 2012 14:35:03 GMT</pubDate>
    <dc:creator>sowings</dc:creator>
    <dc:date>2012-03-29T14:35:03Z</dc:date>
    <item>
      <title>Average Weekly Value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-Weekly-Value/m-p/104223#M26986</link>
      <description>&lt;P&gt;So I was unable to find an answer on here that helped with what I'm trying to do. When I run the following query I get a single number of logins per week.&lt;/P&gt;

&lt;P&gt;host="web01.inno-360.com" AND source="/var/log/apache2/pg_ssl_access.log" AND \/projects\/*\/talent-ecosystems\/createlist | stats count by source&lt;/P&gt;

&lt;P&gt;However I am also wanting to find out what the average number of logins is (per week) since the beginning of the year. Would anyone know how to do this? Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:35:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-Weekly-Value/m-p/104223#M26986</guid>
      <dc:creator>henryt1</dc:creator>
      <dc:date>2020-09-28T11:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: Average Weekly Value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-Weekly-Value/m-p/104224#M26987</link>
      <description>&lt;P&gt;I'd use an eval to set a new variable to the week number (see strftime and %V), then use that value as the "by" field in a stats command.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Mar 2012 14:24:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-Weekly-Value/m-p/104224#M26987</guid>
      <dc:creator>sowings</dc:creator>
      <dc:date>2012-03-29T14:24:51Z</dc:date>
    </item>
    <item>
      <title>Re: Average Weekly Value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-Weekly-Value/m-p/104225#M26988</link>
      <description>&lt;P&gt;Thank you for the input, I've never used eval before (I'm new to Splunk) so what would that query look like?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Mar 2012 14:27:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-Weekly-Value/m-p/104225#M26988</guid>
      <dc:creator>henryt1</dc:creator>
      <dc:date>2012-03-29T14:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: Average Weekly Value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-Weekly-Value/m-p/104226#M26989</link>
      <description>&lt;P&gt;Something like "search=foo ... | stats command_to_get_daily_count | eval wnum=strftime(_time, "%V") | stats avg(count) by wnum"&lt;/P&gt;</description>
      <pubDate>Thu, 29 Mar 2012 14:35:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-Weekly-Value/m-p/104226#M26989</guid>
      <dc:creator>sowings</dc:creator>
      <dc:date>2012-03-29T14:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: Average Weekly Value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-Weekly-Value/m-p/104227#M26990</link>
      <description>&lt;P&gt;I know this is an old post, but I created the below search query below.  Should work for anyone looking for their average over the past 7 days.  It's a big ugly search and I'm sure there is a way to simply this or to heavily utilize eval but this is what I ended up with.  Hope it helps everyone.&lt;BR /&gt;
index=_internal source=*license_usage.log type=usage&lt;BR /&gt;&lt;BR /&gt;
| eval GB = b/1024/1024/1024&lt;BR /&gt;&lt;BR /&gt;
| timechart span=1d sum(GB) by pool&lt;BR /&gt;&lt;BR /&gt;
| eval Time=strftime(_time, "%m/%d/%Y")&lt;BR /&gt;&lt;BR /&gt;
| fieldformat auto_generated_pool_enterprise=tostring(auto_generated_pool_enterprise, "commas"). " GB"&lt;BR /&gt;&lt;BR /&gt;
| fields - _time&lt;BR /&gt;&lt;BR /&gt;
| addcoltotals auto_generated_pool_enterprise label=Total labelfield=weeklytotal &lt;BR /&gt;
| fields Time,auto_generated_pool_enterprise, weeklytotal&lt;BR /&gt;
| search weeklytotal=Total auto_generated_pool_enterprise&amp;gt;1*GB &lt;BR /&gt;
| eval weekly_average=(auto_generated_pool_enterprise/7) &lt;BR /&gt;
|eval Total_weekly_average=round(weekly_average,2) &lt;BR /&gt;
| table Total_weekly_average &lt;BR /&gt;
| rename Total_weekly_average AS "Average over the past 7 days"&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:32:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-Weekly-Value/m-p/104227#M26990</guid>
      <dc:creator>Sarmbrister</dc:creator>
      <dc:date>2020-09-29T11:32:22Z</dc:date>
    </item>
  </channel>
</rss>

