<?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: Check if certain events occurs N consecutive times in Other Usage</title>
    <link>https://community.splunk.com/t5/Other-Usage/How-to-check-if-certain-events-occurs-N-consecutive-times/m-p/647789#M781</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/249714"&gt;@SplunkExplorer&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me understand: when you sai consecutive events, are you meaning events in the reference period or that between these events athere isn't any othe event?&lt;/P&gt;&lt;P&gt;In the first case, you can run a simple search like the following :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=wineventlog Eventcode=4776
| stats count BY host user
| where count&amp;gt;3&lt;/LI-CODE&gt;&lt;P&gt;if the second the solution is more complex, I''l think to it.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Wed, 21 Jun 2023 13:30:09 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2023-06-21T13:30:09Z</dc:date>
    <item>
      <title>How to check if certain events occurs N consecutive times?</title>
      <link>https://community.splunk.com/t5/Other-Usage/How-to-check-if-certain-events-occurs-N-consecutive-times/m-p/647719#M780</link>
      <description>&lt;P&gt;Hi Splunkers, I have to build a rule, based on Windows Logs (XML ones), that must check this:&lt;/P&gt;
&lt;P&gt;Notify me is there are at least&lt;STRONG&gt; 3 consecutive occurreces&lt;/STRONG&gt; of EventID 4776 from a list of host. Tje desiderd output must show:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Host&lt;/LI&gt;
&lt;LI&gt;Number of consecutive events&lt;/LI&gt;
&lt;LI&gt;User/account associated to&amp;nbsp; events&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;So for example, if we have that&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Host A has 4 consecutive events of EventID 4776 for user "Admin"&lt;/LI&gt;
&lt;LI&gt;Host B has 19 consecutive events of EventID 4776 for user "Test"&lt;/LI&gt;
&lt;LI&gt;Host C has 2 consecutive events of EventID 4776 for user "Joker"&lt;/LI&gt;
&lt;LI&gt;Host D has 3 Events of EvenID 4776, but only 2 consecutive; than has another different event and only after this another occurrence of 4776 for user "Hello"&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Host C don't match the consecutive count clause and must be escluded; same for Host D, because he has 3 events but not consecutive. The expected output is:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;Host&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;User&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;N. of consecutive events&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;A&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;Admin&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;B&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;Test&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;19&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What get me in stuck here is how to check that events are consecutive.Any suggestion?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2023 00:37:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/How-to-check-if-certain-events-occurs-N-consecutive-times/m-p/647719#M780</guid>
      <dc:creator>SplunkExplorer</dc:creator>
      <dc:date>2023-06-22T00:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: Check if certain events occurs N consecutive times</title>
      <link>https://community.splunk.com/t5/Other-Usage/How-to-check-if-certain-events-occurs-N-consecutive-times/m-p/647789#M781</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/249714"&gt;@SplunkExplorer&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me understand: when you sai consecutive events, are you meaning events in the reference period or that between these events athere isn't any othe event?&lt;/P&gt;&lt;P&gt;In the first case, you can run a simple search like the following :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=wineventlog Eventcode=4776
| stats count BY host user
| where count&amp;gt;3&lt;/LI-CODE&gt;&lt;P&gt;if the second the solution is more complex, I''l think to it.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2023 13:30:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/How-to-check-if-certain-events-occurs-N-consecutive-times/m-p/647789#M781</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-06-21T13:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: Check if certain events occurs N consecutive times</title>
      <link>https://community.splunk.com/t5/Other-Usage/How-to-check-if-certain-events-occurs-N-consecutive-times/m-p/647797#M783</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;, it is the second option you mentioned: no other events between the desired one must be present.&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;15:00:00: Eventd ID 4776 for user gcusello&lt;BR /&gt;15:00:01: Eventd ID 4776 for user gcusello&lt;BR /&gt;15:00:02: Eventd ID 4776 for user gcusello&lt;/P&gt;&lt;P&gt;is fine, while:&lt;/P&gt;&lt;P&gt;15:00:00: Eventd ID 4776 for user gcusello&lt;BR /&gt;15:00:01: Eventd ID 4776 for user gcusello&lt;BR /&gt;15:00:02: Eventd ID 4625 for user gcusello&lt;BR /&gt;15:00:03: Eventd ID 4776 for user gcusello&lt;/P&gt;&lt;P&gt;it isn't.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2023 13:41:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/How-to-check-if-certain-events-occurs-N-consecutive-times/m-p/647797#M783</guid>
      <dc:creator>SplunkExplorer</dc:creator>
      <dc:date>2023-06-21T13:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: Check if certain events occurs N consecutive times</title>
      <link>https://community.splunk.com/t5/Other-Usage/How-to-check-if-certain-events-occurs-N-consecutive-times/m-p/647798#M784</link>
      <description>&lt;P&gt;I think that this is doable with&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/9.0.5/SearchReference/Streamstats" target="_blank" rel="noopener"&gt;https://docs.splunk.com/Documentation/Splunk/9.0.5/SearchReference/Streamstats&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Just use reset_before/after which suite better for you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| streamstats reset_before="EventID!=4776" count by host user EventID
| where count &amp;gt; 3&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2023 13:58:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/How-to-check-if-certain-events-occurs-N-consecutive-times/m-p/647798#M784</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2023-06-21T13:58:04Z</dc:date>
    </item>
  </channel>
</rss>

