<?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 search a weekly average  and daily total? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-weekly-average-and-daily-total/m-p/188053#M54171</link>
    <description>&lt;P&gt;Getting started with stats, eventstats and streamstats may be what you  are looking for.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://blogs.splunk.com/2014/04/01/search-command-stats-eventstats-and-streamstats-2/"&gt;http://blogs.splunk.com/2014/04/01/search-command-stats-eventstats-and-streamstats-2/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;If that does not help more info will be needed.&lt;/P&gt;</description>
    <pubDate>Tue, 19 May 2015 19:43:48 GMT</pubDate>
    <dc:creator>thomrs</dc:creator>
    <dc:date>2015-05-19T19:43:48Z</dc:date>
    <item>
      <title>How to search a weekly average  and daily total?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-weekly-average-and-daily-total/m-p/188050#M54168</link>
      <description>&lt;P&gt;Hi Sir:&lt;/P&gt;

&lt;P&gt;The first query I calculate the daily amount, calculated after the date +7 days, the average amount of 5/9 to 5/16, the field name is Totalweekqty, Totalweekqty still calculate the number of the day. How do i make |search now &amp;lt; week| or   | where now &amp;lt; month | working? Thank you.&lt;/P&gt;

&lt;P&gt;sourcetype=xxx PartNo=123 VendorCode=1000 storage_in_date=2014-05-09* &lt;BR /&gt;
| eval Indate = substr(storage_in_date, 1, len(storage_in_date)-13)&lt;BR /&gt;
| eval now = strptime(Indate, "%Y-%m-%d") &lt;BR /&gt;
|eval week=(now+604800) &lt;BR /&gt;
|eval month=(now+2592000) &lt;BR /&gt;
| stats sum(qty) as Totaldayqty values(now) as now values(week) as week values(month) as month by VendorCode,PartNo&lt;BR /&gt;&lt;BR /&gt;
|search now &amp;lt; week &lt;BR /&gt;
|  stats values(Totaldayqty) as Totaldayqty avg(Totaldayqty) as Totalweekqty values(now) as now values(week) as week values(month) as month by VendorCode,PartNo&lt;BR /&gt;&lt;BR /&gt;
| where now &amp;lt; month |  stats values(Totaldayqty) as Totaldayqty values(Totalweekqty) as Totalweekqty avg(Totalweekqty) as Totalmonthkqty by VendorCode,PartNo |&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:54:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-weekly-average-and-daily-total/m-p/188050#M54168</guid>
      <dc:creator>chengyu</dc:creator>
      <dc:date>2020-09-28T19:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to search a weekly average  and daily total?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-weekly-average-and-daily-total/m-p/188051#M54169</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;As you are constructing week and month from now, following case will be always true&lt;/P&gt;

&lt;P&gt;now &amp;lt; week &amp;lt; month&lt;/P&gt;

&lt;P&gt;Also, for all the events, you will get same values for now, week, and month.&lt;/P&gt;

&lt;P&gt;Can you please explain what is required? If possible, share some sample events and what is the expected output.&lt;/P&gt;

&lt;P&gt;Thanks!!&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2015 05:34:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-weekly-average-and-daily-total/m-p/188051#M54169</guid>
      <dc:creator>vganjare</dc:creator>
      <dc:date>2015-05-14T05:34:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to search a weekly average  and daily total?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-weekly-average-and-daily-total/m-p/188052#M54170</link>
      <description>&lt;P&gt;You need to scrap everything after the first pipe ("|"), show us a few events from your base search, and then clearly explain what you are trying to accomplish.  Your search makes no sense and there is not enough explanation to allow us to understand what you are trying to do.&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2015 15:13:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-weekly-average-and-daily-total/m-p/188052#M54170</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-05-19T15:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to search a weekly average  and daily total?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-weekly-average-and-daily-total/m-p/188053#M54171</link>
      <description>&lt;P&gt;Getting started with stats, eventstats and streamstats may be what you  are looking for.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://blogs.splunk.com/2014/04/01/search-command-stats-eventstats-and-streamstats-2/"&gt;http://blogs.splunk.com/2014/04/01/search-command-stats-eventstats-and-streamstats-2/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;If that does not help more info will be needed.&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2015 19:43:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-weekly-average-and-daily-total/m-p/188053#M54171</guid>
      <dc:creator>thomrs</dc:creator>
      <dc:date>2015-05-19T19:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to search a weekly average  and daily total?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-weekly-average-and-daily-total/m-p/188054#M54172</link>
      <description>&lt;P&gt;Hi Guys, finally use "delta" command, thank you everybody kindly support.&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2015 05:13:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-weekly-average-and-daily-total/m-p/188054#M54172</guid>
      <dc:creator>chengyu</dc:creator>
      <dc:date>2015-05-20T05:13:45Z</dc:date>
    </item>
  </channel>
</rss>

