<?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 calculate the total count of occurances of a timestamp ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-total-count-of-occurances-of-a-timestamp/m-p/629265#M218580</link>
    <description>&lt;P&gt;Basically I have a set of raw data with different time stamp in CCYYMMDDHHMMSS format. I want to list out the stats which shows how many occurrences of CCYY then MM then DD . I am able to use STRFTIME to get the segregate the data into desired format as year month and day.&lt;BR /&gt;My expected result output is&lt;/P&gt;&lt;TABLE border="1" width="100.00000000000001%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;Year&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;Year Count&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;Month&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;Month Count&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;Day&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;DayCount&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;2022&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;1000&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;2022-11&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;250&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;2022-11-27&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;2023&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;10&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;2022-12&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;100&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;2022-11-12&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;2022-11-27&lt;/TD&gt;&lt;TD&gt;35&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;I used the below&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|stats count as total by year, month day&lt;/LI-CODE&gt;&lt;P&gt;But the actual output is not as expected&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;Year&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;Year Count&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;Month&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;Month Count&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;Day&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;DayCount&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;2022&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;20&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;2022-11&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;20&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;2022-11-27&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;2022&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;5&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;2022-12&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;5&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;2022-11-12&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022&lt;/TD&gt;&lt;TD&gt;35&lt;/TD&gt;&lt;TD&gt;2022-27&lt;/TD&gt;&lt;TD&gt;35&lt;/TD&gt;&lt;TD&gt;2022-11-27&lt;/TD&gt;&lt;TD&gt;35&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Should be simple enough, just not for me. Please help.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Thu, 02 Feb 2023 01:47:42 GMT</pubDate>
    <dc:creator>naveenalagu</dc:creator>
    <dc:date>2023-02-02T01:47:42Z</dc:date>
    <item>
      <title>How to calculate the total count of occurances of a timestamp ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-total-count-of-occurances-of-a-timestamp/m-p/629265#M218580</link>
      <description>&lt;P&gt;Basically I have a set of raw data with different time stamp in CCYYMMDDHHMMSS format. I want to list out the stats which shows how many occurrences of CCYY then MM then DD . I am able to use STRFTIME to get the segregate the data into desired format as year month and day.&lt;BR /&gt;My expected result output is&lt;/P&gt;&lt;TABLE border="1" width="100.00000000000001%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;Year&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;Year Count&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;Month&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;Month Count&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;Day&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;DayCount&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;2022&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;1000&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;2022-11&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;250&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;2022-11-27&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;2023&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;10&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;2022-12&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;100&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;2022-11-12&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;2022-11-27&lt;/TD&gt;&lt;TD&gt;35&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;I used the below&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|stats count as total by year, month day&lt;/LI-CODE&gt;&lt;P&gt;But the actual output is not as expected&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;Year&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;Year Count&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;Month&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;Month Count&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;Day&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;DayCount&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;2022&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;20&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;2022-11&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;20&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;2022-11-27&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;2022&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;5&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;2022-12&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;5&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;2022-11-12&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022&lt;/TD&gt;&lt;TD&gt;35&lt;/TD&gt;&lt;TD&gt;2022-27&lt;/TD&gt;&lt;TD&gt;35&lt;/TD&gt;&lt;TD&gt;2022-11-27&lt;/TD&gt;&lt;TD&gt;35&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Should be simple enough, just not for me. Please help.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 01:47:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-total-count-of-occurances-of-a-timestamp/m-p/629265#M218580</guid>
      <dc:creator>naveenalagu</dc:creator>
      <dc:date>2023-02-02T01:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the total count of occurances of a timestamp ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-total-count-of-occurances-of-a-timestamp/m-p/629289#M218596</link>
      <description>&lt;LI-CODE lang="markup"&gt;| stats count as DayCount by Year Month Day
| eventstats sum(DayCount) as MonthCount by Year Month
| eventstats sum(DayCount) as YearCount by Year&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 02 Feb 2023 08:14:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-total-count-of-occurances-of-a-timestamp/m-p/629289#M218596</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-02-02T08:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the total count of occurances of a timestamp ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-total-count-of-occurances-of-a-timestamp/m-p/629309#M218608</link>
      <description>&lt;P&gt;Alternatively, if eventstats gets slow because there are too many events, you can stats as the first command.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats count as "Day Count" by year, month day ``` reduces rows to number of days in all events ```
| eventstats sum('Day Count') as "Month Count" by year month
| eventstats sum('Month Count') as "Year Count" by year&lt;/LI-CODE&gt;&lt;P&gt;Just to point out: the desired output your illustrated is not "&lt;SPAN&gt;occurrences of CCYY then MM then DD," but occurrences of CCYY, then CCYYMM, then CCYYMMDD. &amp;nbsp;Additionally, 2022-27 is not a very good illustration of Month.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 10:25:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-total-count-of-occurances-of-a-timestamp/m-p/629309#M218608</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-02-02T10:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the total count of occurances of a timestamp ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-total-count-of-occurances-of-a-timestamp/m-p/629312#M218610</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;Just to point out: the desired output your illustrated is not "&lt;SPAN&gt;occurrences of CCYY then MM then DD," but occurrences of CCYY, then CCYYMM, then CCYYMMDD. &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This is correct. I would have to further drill down to HH MM SS as well, which would be CCYYMMHHMMSS.&amp;nbsp; Thanks for the info.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;SPAN&gt;&amp;nbsp;Additionally, 2022-27 is not a very good illustration of Month.&lt;/SPAN&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Apologies for this.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 10:54:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-total-count-of-occurances-of-a-timestamp/m-p/629312#M218610</guid>
      <dc:creator>naveenalagu</dc:creator>
      <dc:date>2023-02-02T10:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the total count of occurances of a timestamp ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-total-count-of-occurances-of-a-timestamp/m-p/629314#M218611</link>
      <description>&lt;P&gt;Thanks a lot for this.&lt;BR /&gt;However, the Table comes out with repeated values for Year and Month.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="naveenalagu_0-1675335375095.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/23675iA3B3B30D1F8EB8C3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="naveenalagu_0-1675335375095.png" alt="naveenalagu_0-1675335375095.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;DEDUP seems to remove entries of other Columns as well. Is there any way to remove those duplicates?&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 10:58:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-total-count-of-occurances-of-a-timestamp/m-p/629314#M218611</guid>
      <dc:creator>naveenalagu</dc:creator>
      <dc:date>2023-02-02T10:58:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the total count of occurances of a timestamp ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-total-count-of-occurances-of-a-timestamp/m-p/629322#M218615</link>
      <description>&lt;LI-CODE lang="markup"&gt;&amp;lt;yoursearch&amp;gt;
| stats count as DayCount by Day
| appendcols 
    [&amp;lt;yoursearchagain&amp;gt;
| stats count as MonthCount by Month]
| appendcols
    [&amp;lt;yoursearchagain&amp;gt;
| stats count as YearCount by Year]&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 02 Feb 2023 12:36:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-total-count-of-occurances-of-a-timestamp/m-p/629322#M218615</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-02-02T12:36:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the total count of occurances of a timestamp ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-total-count-of-occurances-of-a-timestamp/m-p/629358#M218629</link>
      <description>&lt;P&gt;Thanks! That did the trick.&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 15:45:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-total-count-of-occurances-of-a-timestamp/m-p/629358#M218629</guid>
      <dc:creator>naveenalagu</dc:creator>
      <dc:date>2023-02-02T15:45:35Z</dc:date>
    </item>
  </channel>
</rss>

