<?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 edit my search to get the total count by week and by month? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-get-the-total-count-by-week-and-by/m-p/193032#M55523</link>
    <description>&lt;P&gt;Try this: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=abcd.csv| bucket span=7d _time| eval week_month=strftime(_time, "%d/%m")|chart  count by week_month|replace */01 with */january in week_month|replace */02 with */February in week_month|replace */03 with */martch in week_month ............................
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or :  &lt;CODE&gt;source=abcd.csv| bucket span=7d _time| eval week_month=strftime(_time, "%d/%b")|chart  count by week_month&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;here is an example you can take as a template with the &lt;STRONG&gt;_internal&lt;/STRONG&gt; index:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=*|bucket span=7d _time| eval w_month=strftime(_time, "%d/%m")|chart  count by w_month|replace */01 with */january in w_month|replace */02 with */February in w_month|replace */03 with */martch in w_month|replace */04 with */April in w_month
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or more simply : &lt;CODE&gt;index=_internal sourcetype=*|bucket span=7d _time| eval w_month=strftime(_time, "%d/%b")|chart  count by w_month&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 27 Mar 2015 01:39:29 GMT</pubDate>
    <dc:creator>stephanefotso</dc:creator>
    <dc:date>2015-03-27T01:39:29Z</dc:date>
    <item>
      <title>How to edit my search to get the total count by week and by month?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-get-the-total-count-by-week-and-by/m-p/193028#M55519</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;

&lt;P&gt;Below query gives me output as shown below in sorted order&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=abcd.csv| fields Date,count | stats by Date,count | eval Date=strptime(Date, "%d/%m/%Y") | sort Date | eval Date=strftime(Date, "%d/%m/%Y")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Output:&lt;BR /&gt;
16/03/2015,10&lt;BR /&gt;
18/03/2015,20&lt;BR /&gt;
23/03/2015,5&lt;BR /&gt;
24/03/2015,15&lt;/P&gt;

&lt;P&gt;Could you help me in getting total count by week and month?&lt;/P&gt;

&lt;P&gt;i.e., I want the count for week ending 22/mar as 30 and week ending 29/mar as 20. Like wise, need for monthly for february/march,etc&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2015 06:01:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-get-the-total-count-by-week-and-by/m-p/193028#M55519</guid>
      <dc:creator>karthikTIL</dc:creator>
      <dc:date>2015-03-24T06:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to get the total count by week and by month?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-get-the-total-count-by-week-and-by/m-p/193029#M55520</link>
      <description>&lt;P&gt;Use span with buckets in your search,&lt;BR /&gt;
eg: |bucket span=7d _time or |bucket span=1mon _time&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.2/SearchReference/Bucket"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.2/SearchReference/Bucket&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.2/SearchReference/Timechart"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.2/SearchReference/Timechart&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Hope it can help you.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2015 06:35:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-get-the-total-count-by-week-and-by/m-p/193029#M55520</guid>
      <dc:creator>neelamssantosh</dc:creator>
      <dc:date>2015-03-24T06:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to get the total count by week and by month?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-get-the-total-count-by-week-and-by/m-p/193030#M55521</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Following can be used to get the week number in the year.&lt;BR /&gt;
    | eval week=strftime(_time, "%U")&lt;/P&gt;

&lt;P&gt;More formats available at &lt;A href="https://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior"&gt;https://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Thanks!!&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2015 06:52:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-get-the-total-count-by-week-and-by/m-p/193030#M55521</guid>
      <dc:creator>vganjare</dc:creator>
      <dc:date>2015-03-24T06:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to get the total count by week and by month?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-get-the-total-count-by-week-and-by/m-p/193031#M55522</link>
      <description>&lt;P&gt;Hi &lt;BR /&gt;
try  this for count by week&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=abcd.csv|timechart  span="1w" count  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and the following for count by month&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=abcd.csv|timechart  span="4w" count  
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Mar 2015 12:52:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-get-the-total-count-by-week-and-by/m-p/193031#M55522</guid>
      <dc:creator>chimell</dc:creator>
      <dc:date>2015-03-24T12:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to get the total count by week and by month?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-get-the-total-count-by-week-and-by/m-p/193032#M55523</link>
      <description>&lt;P&gt;Try this: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=abcd.csv| bucket span=7d _time| eval week_month=strftime(_time, "%d/%m")|chart  count by week_month|replace */01 with */january in week_month|replace */02 with */February in week_month|replace */03 with */martch in week_month ............................
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or :  &lt;CODE&gt;source=abcd.csv| bucket span=7d _time| eval week_month=strftime(_time, "%d/%b")|chart  count by week_month&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;here is an example you can take as a template with the &lt;STRONG&gt;_internal&lt;/STRONG&gt; index:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=*|bucket span=7d _time| eval w_month=strftime(_time, "%d/%m")|chart  count by w_month|replace */01 with */january in w_month|replace */02 with */February in w_month|replace */03 with */martch in w_month|replace */04 with */April in w_month
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or more simply : &lt;CODE&gt;index=_internal sourcetype=*|bucket span=7d _time| eval w_month=strftime(_time, "%d/%b")|chart  count by w_month&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2015 01:39:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-get-the-total-count-by-week-and-by/m-p/193032#M55523</guid>
      <dc:creator>stephanefotso</dc:creator>
      <dc:date>2015-03-27T01:39:29Z</dc:date>
    </item>
  </channel>
</rss>

