<?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 create an alert when a windows account is lockout and there is an unlock event within 5 mins of the being locked in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-when-a-windows-account-is-lockout-and/m-p/496520#M138360</link>
    <description>&lt;P&gt;Hi @djreschke,&lt;BR /&gt;
you could use the transaction command or the stats command, &lt;/P&gt;

&lt;P&gt;with transaction something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wineventlog EventCode=4767 OR EventCode=4740
| transaction  host Account_Name startswith="EventCode=4767" endswith="EventCode=4740" maxspan=300s
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or without transaction:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wineventlog EventCode=4767 OR EventCode=4740
| stats dc(EventCode) AS dcount earliest(_time) AS earliest  ltest(_time) AS latest BY host Account_Name
| where dcount=2 AND latest-earliest&amp;lt;300
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The second one is more performant.&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
    <pubDate>Wed, 04 Dec 2019 07:54:28 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2019-12-04T07:54:28Z</dc:date>
    <item>
      <title>How to create an alert when a windows account is lockout and there is an unlock event within 5 mins of the being locked</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-when-a-windows-account-is-lockout-and/m-p/496519#M138359</link>
      <description>&lt;P&gt;Good afternoon everyone,&lt;/P&gt;

&lt;P&gt;Can someone point me in the right direction to creating an alert when a windows account is lockout and there is an unlock event within 5 mins of the being locked. I have the search built for both events but I am having trouble adding in the condition of the unlock event within 5 minutes. &lt;/P&gt;

&lt;P&gt;Any help would be appreciated. Thank you&lt;/P&gt;

&lt;P&gt;Here is the search I built to join the two searches but this is not what I am looking for:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wineventlog EventCode=4767 
| bin _time span=5m 
| stats count by Account_Name name 
| sort - count 
| rename count AS "Number of Unlocks" name AS "Unlock_Description" 
| join Account_Name 
    [ search index=wineventlog  EventCode=4740 
    | bin _time span=5m 
    | stats count by Account_Name name 
    | sort - count 
    | rename count AS "Number of Lockouts" name AS "Lockout_Description"] 
| table Account_Name "Unlock_Description" "Number of Lockouts" "Lockout_Description" "Number of Unlocks"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Dec 2019 20:21:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-when-a-windows-account-is-lockout-and/m-p/496519#M138359</guid>
      <dc:creator>djreschke</dc:creator>
      <dc:date>2019-12-03T20:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an alert when a windows account is lockout and there is an unlock event within 5 mins of the being locked</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-when-a-windows-account-is-lockout-and/m-p/496520#M138360</link>
      <description>&lt;P&gt;Hi @djreschke,&lt;BR /&gt;
you could use the transaction command or the stats command, &lt;/P&gt;

&lt;P&gt;with transaction something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wineventlog EventCode=4767 OR EventCode=4740
| transaction  host Account_Name startswith="EventCode=4767" endswith="EventCode=4740" maxspan=300s
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or without transaction:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wineventlog EventCode=4767 OR EventCode=4740
| stats dc(EventCode) AS dcount earliest(_time) AS earliest  ltest(_time) AS latest BY host Account_Name
| where dcount=2 AND latest-earliest&amp;lt;300
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The second one is more performant.&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 07:54:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-when-a-windows-account-is-lockout-and/m-p/496520#M138360</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-12-04T07:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an alert when a windows account is lockout and there is an unlock event within 5 mins of the being locked</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-when-a-windows-account-is-lockout-and/m-p/496521#M138361</link>
      <description>&lt;P&gt;Giuseppe,&lt;/P&gt;

&lt;P&gt;Thank for the searches, quick question, with the above searches how would I see if there where multiple lock and unlock events with the time frame?&lt;/P&gt;

&lt;P&gt;Best,&lt;/P&gt;

&lt;P&gt;Derek&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 13:35:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-when-a-windows-account-is-lockout-and/m-p/496521#M138361</guid>
      <dc:creator>djreschke</dc:creator>
      <dc:date>2019-12-04T13:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an alert when a windows account is lockout and there is an unlock event within 5 mins of the being locked</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-when-a-windows-account-is-lockout-and/m-p/496522#M138362</link>
      <description>&lt;P&gt;Hi @djreschke,&lt;BR /&gt;
if you're sure that in tha observing period there's only one lock/unlock, you could add a stats count at the end of the search.&lt;/P&gt;

&lt;P&gt;If instead you could have more lock/unlock in the same period, you have to use transaction adding a stats count at the end&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wineventlog EventCode=4767 OR EventCode=4740
| transaction  host Account_Name startswith="EventCode=4767" endswith="EventCode=4740" maxspan=300s
| statas count BY host Account_Name 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 15:55:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-when-a-windows-account-is-lockout-and/m-p/496522#M138362</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-12-04T15:55:05Z</dc:date>
    </item>
  </channel>
</rss>

