<?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: Combine events based on timestamps in event in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Combine-events-based-on-timestamps-in-event/m-p/369631#M108914</link>
    <description>&lt;P&gt;@manuarora12, you can try the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;YourBaseSearch&amp;gt;
|  eval _time=strptime(starttime,"%Y-%m-%d %H:%M:%S")
|  timechart span=1h count by Category
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 14 Nov 2017 20:54:15 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2017-11-14T20:54:15Z</dc:date>
    <item>
      <title>Combine events based on timestamps in event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-events-based-on-timestamps-in-event/m-p/369629#M108912</link>
      <description>&lt;P&gt;I have events as following&lt;BR /&gt;
Category=a starttime="2017-11-14 05:25:22"&lt;BR /&gt;
Category=b starttime="2017-11-14 05:29:22"&lt;BR /&gt;
Category=b starttime="2017-11-14 04:28:18"&lt;BR /&gt;
Category=c starttime="2017-11-14 03:22:21"&lt;BR /&gt;
Category=a starttime="2017-11-14 06:21:28"&lt;/P&gt;

&lt;P&gt;I want all events count by Category by hour of occurance as per starttime. _time might be completely different from starttime.&lt;/P&gt;

&lt;P&gt;So results should say something like&lt;/P&gt;

&lt;P&gt;Hour             Category       Count&lt;BR /&gt;
5                      a                    1&lt;BR /&gt;
                        b                     1&lt;BR /&gt;
6                      b                    1&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 11:10:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-events-based-on-timestamps-in-event/m-p/369629#M108912</guid>
      <dc:creator>manuarora12</dc:creator>
      <dc:date>2017-11-14T11:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: Combine events based on timestamps in event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-events-based-on-timestamps-in-event/m-p/369630#M108913</link>
      <description>&lt;P&gt;What about&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your search&amp;gt; | rex field=starttime "\S{10}\s(?&amp;lt;Hour&amp;gt;\d\d)" | stats count by Hour, Category
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Kai.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 13:16:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-events-based-on-timestamps-in-event/m-p/369630#M108913</guid>
      <dc:creator>knielsen</dc:creator>
      <dc:date>2017-11-14T13:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: Combine events based on timestamps in event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-events-based-on-timestamps-in-event/m-p/369631#M108914</link>
      <description>&lt;P&gt;@manuarora12, you can try the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;YourBaseSearch&amp;gt;
|  eval _time=strptime(starttime,"%Y-%m-%d %H:%M:%S")
|  timechart span=1h count by Category
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Nov 2017 20:54:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-events-based-on-timestamps-in-event/m-p/369631#M108914</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-11-14T20:54:15Z</dc:date>
    </item>
  </channel>
</rss>

