<?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 count the number of events by types that occurred during each period of time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-events-by-types-that-occurred-during/m-p/441235#M125358</link>
    <description>&lt;P&gt;Can you try the below,I think the below should work!!&lt;/P&gt;

&lt;P&gt;basequery| eval time=strftime(_time, "%Y-%m-%d")| stats count by time,EventCode&lt;/P&gt;

&lt;P&gt;And select the timerange for the last two days.&lt;/P&gt;

&lt;P&gt;OR &lt;/P&gt;

&lt;P&gt;basequery | bin _time span=1d | stats count by _time,EventCode&lt;/P&gt;</description>
    <pubDate>Fri, 31 Aug 2018 21:11:41 GMT</pubDate>
    <dc:creator>nadlurinadluri</dc:creator>
    <dc:date>2018-08-31T21:11:41Z</dc:date>
    <item>
      <title>How to count the number of events by types that occurred during each period of time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-events-by-types-that-occurred-during/m-p/441234#M125357</link>
      <description>&lt;P&gt;How to count the number of events by types that occurred during each period of time (for example, yesterday and the day before yesterday).&lt;BR /&gt;
Tell me how to fix it:&lt;BR /&gt;
… “EventType=4*” | eval dt1=EventType WHERE _time=relative_data(“-1d@d”, “0d@d”), dt2=EventType WHERE _time=relative_data(“-2d@d”, “-1d@d”) | stats count by EventCode | table  EventCode dt1 dt2&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:07:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-events-by-types-that-occurred-during/m-p/441234#M125357</guid>
      <dc:creator>svchnik</dc:creator>
      <dc:date>2020-09-29T21:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the number of events by types that occurred during each period of time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-events-by-types-that-occurred-during/m-p/441235#M125358</link>
      <description>&lt;P&gt;Can you try the below,I think the below should work!!&lt;/P&gt;

&lt;P&gt;basequery| eval time=strftime(_time, "%Y-%m-%d")| stats count by time,EventCode&lt;/P&gt;

&lt;P&gt;And select the timerange for the last two days.&lt;/P&gt;

&lt;P&gt;OR &lt;/P&gt;

&lt;P&gt;basequery | bin _time span=1d | stats count by _time,EventCode&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2018 21:11:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-events-by-types-that-occurred-during/m-p/441235#M125358</guid>
      <dc:creator>nadlurinadluri</dc:creator>
      <dc:date>2018-08-31T21:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the number of events by types that occurred during each period of time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-events-by-types-that-occurred-during/m-p/441236#M125359</link>
      <description>&lt;P&gt;This will not give the desired result.&lt;BR /&gt;
Separately for each period I did, but I do not know how to combine these three requests into one.&lt;BR /&gt;
3 days ago&lt;BR /&gt;
... EventCode="&lt;EM&gt;" | WHERE _time &amp;gt;= relative_time(now(), "-2d@d") AND _time &amp;lt;= relative_time(now(), "-1d@d")| stats count by EventCode&lt;BR /&gt;
2 days ago&lt;BR /&gt;
... EventCode="&lt;/EM&gt;" | WHERE _time &amp;gt;= relative_time(now(), "-1d@d") AND _time &amp;lt;= relative_time(now(), "-0d@d")| stats count by EventCode&lt;BR /&gt;
1 days ago&lt;BR /&gt;
... EventCode="*" | WHERE _time &amp;gt;= relative_time(now(), "-0d@d") AND _time &amp;lt;= now() | stats count by EventCode&lt;/P&gt;

&lt;P&gt;or so&lt;BR /&gt;
... EventCode="&lt;EM&gt;" earliest=-2d@d latest=-1d@d | stats count by EventCode | rename count as dt3 &lt;BR /&gt;
... EventCode="&lt;/EM&gt;" earliest=-1d@d latest=-0d@d | stats count by EventCode | rename count as dt2 &lt;BR /&gt;
... EventCode="*" earliest=-0d@d | stats count by EventCode | rename count as dt1&lt;/P&gt;

&lt;P&gt;I tried to connect, but it does not work correctly:&lt;BR /&gt;
source="WinEventLog:Security" EventCode="&lt;EM&gt;" earliest=-2d@d latest=-1d@d | stats count by EventCode | rename count as dt3 | appendcols [ search source="WinEventLog:Security" EventCode="&lt;/EM&gt;" earliest=-1d@d latest=-0d@d | stats count by EventCode | rename count as dt2] | appendcols [ search source="WinEventLog:Security" EventCode="*" earliest=-0d@d | stats count by EventCode | rename count as dt1]&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:06:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-events-by-types-that-occurred-during/m-p/441236#M125359</guid>
      <dc:creator>svchnik</dc:creator>
      <dc:date>2020-09-29T21:06:20Z</dc:date>
    </item>
  </channel>
</rss>

