<?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 group the count of daily events by their month? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-the-count-of-daily-events-by-their-month/m-p/651584#M225264</link>
    <description>&lt;P&gt;Which one worked? Can you accept the one that worked, so the solution as there are multiple suggestions - it's not clear if you don't see the hierarchy, which one you are replying to.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 22 Jul 2023 07:37:57 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2023-07-22T07:37:57Z</dc:date>
    <item>
      <title>How to group the count of daily events by their month?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-the-count-of-daily-events-by-their-month/m-p/650993#M225258</link>
      <description>&lt;P&gt;Hi and just reaching out as stumped. Very grateful for assistance. This query returns the following in the statistics tab:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;index="ds" (tags_rule="Jason" OR tags_rule="Bill" OR tags_rule=”Smithy”)&lt;BR /&gt;| timechart span=1d dc(Device_Name) as Number_of_Devices by tags_rule&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="csar5634_0-1689684061965.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/26327iD544CCD5960622EE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="csar5634_0-1689684061965.png" alt="csar5634_0-1689684061965.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The next step i'd like to do is then count up all the values in the columns and group them by the respective month. So it would look like the below. Just not having any luck figuring out the right query. Thanks in advance!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="csar5634_1-1689684222679.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/26328iED35AC48507E42EB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="csar5634_1-1689684222679.png" alt="csar5634_1-1689684222679.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2023 12:45:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-the-count-of-daily-events-by-their-month/m-p/650993#M225258</guid>
      <dc:creator>csar5634</dc:creator>
      <dc:date>2023-07-18T12:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to group the count of daily events by their month?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-the-count-of-daily-events-by-their-month/m-p/650994#M225259</link>
      <description>&lt;P&gt;1. You don't need to timechart per day if you want to finally aggregate by month &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;2. Render a month from the date using&lt;/P&gt;&lt;PRE&gt;| eval month=strftime(_time,"%m")&lt;/PRE&gt;&lt;P&gt;And now you can use that field to split your stats by&lt;/P&gt;&lt;PRE&gt;| stats dc(Device_Name) as 'Number of Devices' by tags_rule month&lt;/PRE&gt;&lt;P&gt;So your search effectively looks like this:&lt;/P&gt;&lt;PRE&gt;index="ds" (tags_rule="Jason" OR tags_rule="Bill" OR tags_rule=”Smithy”)&lt;BR /&gt;| eval month=strftime(_time,"%m")&lt;BR /&gt;| stats dc(Device_Name) as 'Number of Devices' by tags_rule month&lt;/PRE&gt;&lt;P&gt;Finally you can do xyseries to print it in a tabular form if you want.&lt;/P&gt;&lt;P&gt;Theoretically, you could use the default time-related fields but I don't trust them.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2023 13:08:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-the-count-of-daily-events-by-their-month/m-p/650994#M225259</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-07-18T13:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to group the count of daily events by their month?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-the-count-of-daily-events-by-their-month/m-p/651020#M225260</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/258813"&gt;@csar5634&lt;/a&gt;&amp;nbsp;You are using DC to calculate unique devices per day but want the total by month, i.e. in your example Jason has a total of 4. If that is the same device you still want SUM of those DC counts?&lt;/P&gt;&lt;P&gt;If it's the same device or different devices you still want the result to be 4?&lt;/P&gt;&lt;P&gt;If you want that to be 4 then just add the timechart&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| timechart span=1mon sum(*) as *&lt;/LI-CODE&gt;&lt;P&gt;if you then want to change the date format to be MMM-YY instead of YYYY-MM just add this to the end&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| fieldformat _time=strftime(_time, "%b-%y")&lt;/LI-CODE&gt;&lt;P&gt;if you want the DC() to reflect unique devices in the whole month then change the initial span to span=1mon&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2023 15:10:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-the-count-of-daily-events-by-their-month/m-p/651020#M225260</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-07-18T15:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to group the count of daily events by their month?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-the-count-of-daily-events-by-their-month/m-p/651074#M225261</link>
      <description>&lt;P&gt;Awesome, this one worked. So simple in the end. Thanks for the prompt response.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2023 07:15:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-the-count-of-daily-events-by-their-month/m-p/651074#M225261</guid>
      <dc:creator>csar5634</dc:creator>
      <dc:date>2023-07-19T07:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to group the count of daily events by their month?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-the-count-of-daily-events-by-their-month/m-p/651075#M225262</link>
      <description>&lt;P&gt;Thanks for responding. I couldn't get the output from the modification you gave, apols if my question wasn't clear enough. I appreciate you responding.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2023 07:17:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-the-count-of-daily-events-by-their-month/m-p/651075#M225262</guid>
      <dc:creator>csar5634</dc:creator>
      <dc:date>2023-07-19T07:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to group the count of daily events by their month?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-the-count-of-daily-events-by-their-month/m-p/651584#M225264</link>
      <description>&lt;P&gt;Which one worked? Can you accept the one that worked, so the solution as there are multiple suggestions - it's not clear if you don't see the hierarchy, which one you are replying to.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jul 2023 07:37:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-the-count-of-daily-events-by-their-month/m-p/651584#M225264</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-07-22T07:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to group the count of daily events by their month?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-the-count-of-daily-events-by-their-month/m-p/651666#M225279</link>
      <description>&lt;P&gt;Hey and i accepted your's as the solution. It should be noted as such. Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2023 01:09:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-the-count-of-daily-events-by-their-month/m-p/651666#M225279</guid>
      <dc:creator>csar5634</dc:creator>
      <dc:date>2023-07-24T01:09:18Z</dc:date>
    </item>
  </channel>
</rss>

