<?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: Count Events, Group by date field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Count-Events-Group-by-date-field/m-p/152626#M185576</link>
    <description>&lt;P&gt;You could extract the values until the minutes in create_dt_tm field by using Rex Command. &lt;BR /&gt;
With the New field you can simply make a timechart span=1m count by "newfield". &lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 15:21:04 GMT</pubDate>
    <dc:creator>rechteklebe</dc:creator>
    <dc:date>2020-09-28T15:21:04Z</dc:date>
    <item>
      <title>Count Events, Group by date field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-Events-Group-by-date-field/m-p/152625#M185575</link>
      <description>&lt;P&gt;I have data that looks like this that I'm pulling from a db.  Each row is pulling in as one event:&lt;BR /&gt;
trxn_id     create_dt_tm&lt;BR /&gt;
123456      2013-11-22 11:01:22.xxx&lt;BR /&gt;
123457      2013-11-22 11:01:23.xxx&lt;BR /&gt;
123458      2013-11-22 11:01:24.xxx&lt;BR /&gt;
123459      2013-11-22 11:02:22.xxx&lt;BR /&gt;
123460      2013-11-22 11:02:22.xxx&lt;/P&gt;

&lt;P&gt;I'd like the results to look like this in a timechart:&lt;BR /&gt;
Time                Count&lt;BR /&gt;
2013-11-22 11:01    3&lt;BR /&gt;
2013-11-22 11:02    2&lt;BR /&gt;
etc&lt;/P&gt;

&lt;P&gt;When I do something like this below, I'm getting the results in minute but they are grouped by the time in which they were indexed.&lt;BR /&gt;
"index=main | timechart count(edi_trxn_detail_id) span=1m"&lt;/P&gt;

&lt;P&gt;How do I tell splunk to group by the create_dt_tm of the transaction and subsequently by minute? Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:20:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-Events-Group-by-date-field/m-p/152625#M185575</guid>
      <dc:creator>hogan24</dc:creator>
      <dc:date>2020-09-28T15:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: Count Events, Group by date field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-Events-Group-by-date-field/m-p/152626#M185576</link>
      <description>&lt;P&gt;You could extract the values until the minutes in create_dt_tm field by using Rex Command. &lt;BR /&gt;
With the New field you can simply make a timechart span=1m count by "newfield". &lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:21:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-Events-Group-by-date-field/m-p/152626#M185576</guid>
      <dc:creator>rechteklebe</dc:creator>
      <dc:date>2020-09-28T15:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: Count Events, Group by date field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-Events-Group-by-date-field/m-p/152627#M185577</link>
      <description>&lt;P&gt;Try following&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main sourcetype=yoursourcetype| eval create_dt_tm=strptime(create_dt_tm,"%Y-%m-%d %H:%M") | stats count by create_dt_tm | eval create_dt_tm=strftime(create_dt_tm,"%Y-%m-%d %H:%M")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Nov 2013 20:18:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-Events-Group-by-date-field/m-p/152627#M185577</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2013-11-22T20:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: Count Events, Group by date field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-Events-Group-by-date-field/m-p/152628#M185578</link>
      <description>&lt;P&gt;I think I may have figured this one out through suggestions and trial and error...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;create_dt_tm | convert timeformat="%m/%d/%y %H:%M" ctime(create_dt_tm) as Minute | stats count as "Transactions" by Minute
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This gives me the following which is what I was looking for.  Thanks to those who helped!&lt;BR /&gt;
Minute           Transactions&lt;BR /&gt;
11/24/13 10:00   8&lt;BR /&gt;
11/24/13 10:01   6&lt;BR /&gt;
11/24/13 10:02   4&lt;BR /&gt;
etc&lt;/P&gt;</description>
      <pubDate>Sun, 24 Nov 2013 17:48:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-Events-Group-by-date-field/m-p/152628#M185578</guid>
      <dc:creator>hogan24</dc:creator>
      <dc:date>2013-11-24T17:48:45Z</dc:date>
    </item>
  </channel>
</rss>

