<?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 How to group 3 months data, making it average data over 2 years? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-3-months-data-making-it-average-data-over-2-years/m-p/616476#M214253</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;The dates I have are in form of Week Starting: for example WeekStarting = 04/04/2022 , 11/04/2022 and so on.&amp;nbsp;I am unable to group data where business now requires to see 3 months rolling avg figures for the last 2 years.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;How can I achieve this?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;My search:&lt;BR /&gt;index=AB, source=AB&lt;BR /&gt;| search (WeekStarting="2021*" OR WeekStarting="2022*")&lt;BR /&gt;| chart avg(DeviceCount) by WeekStarting&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;It should be visualized as a 3 month data analysis&lt;/P&gt;
&lt;P&gt;I am also trying to use timewrap&amp;nbsp; span =1 month by Device count but no statistics appear!! Please help&lt;/P&gt;</description>
    <pubDate>Tue, 11 Oct 2022 13:17:03 GMT</pubDate>
    <dc:creator>hmohta</dc:creator>
    <dc:date>2022-10-11T13:17:03Z</dc:date>
    <item>
      <title>How to group 3 months data, making it average data over 2 years?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-3-months-data-making-it-average-data-over-2-years/m-p/616476#M214253</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;The dates I have are in form of Week Starting: for example WeekStarting = 04/04/2022 , 11/04/2022 and so on.&amp;nbsp;I am unable to group data where business now requires to see 3 months rolling avg figures for the last 2 years.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;How can I achieve this?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;My search:&lt;BR /&gt;index=AB, source=AB&lt;BR /&gt;| search (WeekStarting="2021*" OR WeekStarting="2022*")&lt;BR /&gt;| chart avg(DeviceCount) by WeekStarting&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;It should be visualized as a 3 month data analysis&lt;/P&gt;
&lt;P&gt;I am also trying to use timewrap&amp;nbsp; span =1 month by Device count but no statistics appear!! Please help&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 13:17:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-3-months-data-making-it-average-data-over-2-years/m-p/616476#M214253</guid>
      <dc:creator>hmohta</dc:creator>
      <dc:date>2022-10-11T13:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to group 3 months data, making it average data over 2 years</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-3-months-data-making-it-average-data-over-2-years/m-p/616480#M214254</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/248543"&gt;@hmohta&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you have to extract the year from the WeekStarting field,&lt;/P&gt;&lt;P&gt;you have meny methods to do this: eval substr, rex, eval strftime.&amp;nbsp;&lt;/P&gt;&lt;P&gt;using the first, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=AB, source=AB
| eval Year=substr(WeekStarting,6,4)
| search Year IN ("2021","2022")
| stats avg(DeviceCount) BY Year&lt;/LI-CODE&gt;&lt;P&gt;Obivously, if you&amp;nbsp;have dates already grouped by week, there's the error of the first and the last week of the year.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 06:21:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-3-months-data-making-it-average-data-over-2-years/m-p/616480#M214254</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-10-10T06:21:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to group 3 months data, making it average data over 2 years</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-3-months-data-making-it-average-data-over-2-years/m-p/616481#M214255</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;. you mention :&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;| eval Year=substr(WeekStarting,6,4)&lt;/PRE&gt;&lt;P&gt;What does 6,4 stand for? Sorry I am new to Splunk and dont understand. Does it mean the Week like Week 6 or Week 4. Do I have to break it over 56 Weeks!? I am confused&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 06:26:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-3-months-data-making-it-average-data-over-2-years/m-p/616481#M214255</guid>
      <dc:creator>hmohta</dc:creator>
      <dc:date>2022-10-10T06:26:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to group 3 months data, making it average data over 2 years</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-3-months-data-making-it-average-data-over-2-years/m-p/616483#M214256</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/248543"&gt;@hmohta&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;as you can read ad&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/9.0.1/SearchReference/TextFunctions#substr.28X.2CY.2CZ.29:" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/9.0.1/SearchReference/TextFunctions#substr.28X.2CY.2CZ.29:&lt;/A&gt;&lt;/P&gt;&lt;P&gt;6 is the starting point of the substring and 4 is the lenght of the substring.&lt;/P&gt;&lt;P&gt;In this way you can extarct the year from the StartingWeek field values to use to group results.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 06:36:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-3-months-data-making-it-average-data-over-2-years/m-p/616483#M214256</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-10-10T06:36:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to group 3 months data, making it average data over 2 years</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-3-months-data-making-it-average-data-over-2-years/m-p/616484#M214257</link>
      <description>&lt;P&gt;Sorry this search is not yielding any results for me. Not sure I understand.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 06:44:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-3-months-data-making-it-average-data-over-2-years/m-p/616484#M214257</guid>
      <dc:creator>hmohta</dc:creator>
      <dc:date>2022-10-10T06:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to group 3 months data, making it average data over 2 years</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-3-months-data-making-it-average-data-over-2-years/m-p/616485#M214258</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/248543"&gt;@hmohta&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;please run this search and tell me the results:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=AB, source=AB
| eval Year=substr(WeekStarting,6,4)
| search Year IN ("2021","2022")
| table Year WeekStarting DeviceCount&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 06:47:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-3-months-data-making-it-average-data-over-2-years/m-p/616485#M214258</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-10-10T06:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to group 3 months data, making it average data over 2 years</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-3-months-data-making-it-average-data-over-2-years/m-p/616487#M214260</link>
      <description>&lt;P&gt;Like I said yields, 0 statistics&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 06:49:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-3-months-data-making-it-average-data-over-2-years/m-p/616487#M214260</guid>
      <dc:creator>hmohta</dc:creator>
      <dc:date>2022-10-10T06:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to group 3 months data, making it average data over 2 years</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-3-months-data-making-it-average-data-over-2-years/m-p/616489#M214262</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/248543"&gt;@hmohta&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;what is the result of my last test search?&lt;/P&gt;&lt;P&gt;have you values i the listed fields or not?&lt;/P&gt;&lt;P&gt;I need this information to understand if the error is in the field format or in the field extraction.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 06:59:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-3-months-data-making-it-average-data-over-2-years/m-p/616489#M214262</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-10-10T06:59:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to group 3 months data, making it average data over 2 years</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-3-months-data-making-it-average-data-over-2-years/m-p/616500#M214266</link>
      <description>&lt;P&gt;I get no values, no statistics.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 09:17:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-3-months-data-making-it-average-data-over-2-years/m-p/616500#M214266</guid>
      <dc:creator>hmohta</dc:creator>
      <dc:date>2022-10-10T09:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to group 3 months data, making it average data over 2 years</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-3-months-data-making-it-average-data-over-2-years/m-p/616501#M214267</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/248543"&gt;@hmohta&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;sorry, please try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=AB, source=AB
| eval Year=substr(WeekStarting,6,4)
| table Year WeekStarting DeviceCount&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 09:35:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-3-months-data-making-it-average-data-over-2-years/m-p/616501#M214267</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-10-10T09:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to group 3 months data, making it average data over 2 years</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-3-months-data-making-it-average-data-over-2-years/m-p/616598#M214303</link>
      <description>&lt;P&gt;Unfortunately it yields no results at all. 0 values/statistics&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 05:58:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-3-months-data-making-it-average-data-over-2-years/m-p/616598#M214303</guid>
      <dc:creator>hmohta</dc:creator>
      <dc:date>2022-10-11T05:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to group 3 months data, making it average data over 2 years</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-3-months-data-making-it-average-data-over-2-years/m-p/616603#M214305</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/248543"&gt;@hmohta&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;please try this, without comma:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=AB source=AB
| eval Year=substr(WeekStarting,6,4)
| table Year WeekStarting DeviceCount&lt;/LI-CODE&gt;&lt;P&gt;if also this search haven't nay result, you should run only the main search and check if the two fields to display are present:&amp;nbsp;WeekStarting, DeviceCount.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 07:06:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-3-months-data-making-it-average-data-over-2-years/m-p/616603#M214305</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-10-11T07:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to group 3 months data, making it average data over 2 years</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-3-months-data-making-it-average-data-over-2-years/m-p/616752#M214355</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp; thankyou&amp;nbsp; so much for trying, still no results and yes I did do the main search and these events do occur. I think I will move on from this question and look how I can produce moving average just like we do in excel. thanks for your help&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 23:35:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-3-months-data-making-it-average-data-over-2-years/m-p/616752#M214355</guid>
      <dc:creator>hmohta</dc:creator>
      <dc:date>2022-10-11T23:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to group 3 months data, making it average data over 2 years</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-3-months-data-making-it-average-data-over-2-years/m-p/616771#M214363</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/248543"&gt;@hmohta&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I don't like that you leave Splunk for Excel, I often use Splunk to elaborate data instead Excel!&lt;/P&gt;&lt;P&gt;Anyway, after the main search&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=AB sourcetype=AB&lt;/LI-CODE&gt;&lt;P&gt;have you the fields&amp;nbsp;&lt;SPAN&gt;WeekStarting, DeviceCount or not?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if not it isn't correct the logic you'r using and you have to find another one, maybe using different fields.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Then check the fieldnames, are they correct? remember that fieldnames are case sensitive.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;could you share a scrennshot of the main search with the intersting fields?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Ciao.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Giuseppe&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;P.S.: Karma Points are appreciated &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 06:38:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-3-months-data-making-it-average-data-over-2-years/m-p/616771#M214363</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-10-12T06:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to group 3 months data, making it average data over 2 years</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-3-months-data-making-it-average-data-over-2-years/m-p/616909#M214396</link>
      <description>&lt;P&gt;I wasn't leaving Splunk for Excel, all I said was I will close this query as I have not achieved what I am after and then ask another question which is what " is used in Excel", but use it in Splunk.&lt;/P&gt;&lt;P&gt;I am aware of the fields being case sensitive, unfortunately nothing works!!&lt;/P&gt;&lt;P&gt;Thankyou for trying.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2022 03:19:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-3-months-data-making-it-average-data-over-2-years/m-p/616909#M214396</guid>
      <dc:creator>hmohta</dc:creator>
      <dc:date>2022-10-13T03:19:26Z</dc:date>
    </item>
  </channel>
</rss>

