<?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 search for any account lockout events, then filter by Active Directory group membership? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-any-account-lockout-events-then-filter-by/m-p/205962#M59894</link>
    <description>&lt;P&gt;I can definitely handle (and have handled) the powershell export and CSV.  Would you mind giving an example of what the lookup would look like in Splunk?  I'm having a failure of imagination on that part.  &lt;/P&gt;</description>
    <pubDate>Tue, 05 Jan 2016 21:54:26 GMT</pubDate>
    <dc:creator>jganger</dc:creator>
    <dc:date>2016-01-05T21:54:26Z</dc:date>
    <item>
      <title>How to search for any account lockout events, then filter by Active Directory group membership?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-any-account-lockout-events-then-filter-by/m-p/205958#M59890</link>
      <description>&lt;P&gt;I found another question on this same subject, but haven't found an answer.  For instance, I'm trying to search for any account lockout events with index=domain-infrastructure EventCode=4740, and then I'd like to filter based on membership in a particular Active Directory group. Is this possible?  &lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2016 14:28:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-any-account-lockout-events-then-filter-by/m-p/205958#M59890</guid>
      <dc:creator>jganger</dc:creator>
      <dc:date>2016-01-05T14:28:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for any account lockout events, then filter by Active Directory group membership?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-any-account-lockout-events-then-filter-by/m-p/205959#M59891</link>
      <description>&lt;P&gt;I'll tell you what I did to solve this problem, although it is not trivial:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;I've got a daily job in PowerShell that reads all the groups and theirs members into an SQL database. Your can use the ActiveDirectory module&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;The same job calculates the effective membership of any given group before inserting it into SQL. That includes nested groups, etc. This is needed in order to end up with a basic table in SQL with just two fields: User, Group. For instance:&lt;/P&gt;

&lt;P&gt;User1, Group1&lt;BR /&gt;
User1, Group2&lt;BR /&gt;
User1, Group3&lt;BR /&gt;
User2, Group1&lt;BR /&gt;
User3, Group3&lt;BR /&gt;
...&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Create a DB lookup in Splunk that points to the table above and returns for any given user, all the groups this user is a member of&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Run your search and then pass this to your lookup in order to enrich every event with group information. It's a one to many map so you should expect more events than before&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Now you can filter by group&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Keep in mind you can probably do the same outside SQL simply by using a CSV file. The only reason I use SQL is because I use the same table in lots of places. &lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
J&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2016 20:12:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-any-account-lockout-events-then-filter-by/m-p/205959#M59891</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-01-05T20:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for any account lockout events, then filter by Active Directory group membership?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-any-account-lockout-events-then-filter-by/m-p/205960#M59892</link>
      <description>&lt;P&gt;Thanks for the response.  That's disappointingly complex though.&lt;/P&gt;

&lt;P&gt;Did you see the SA-ldapsearch app?  I've only come across it briefly but it seems like it might be able to pull in the necessary info.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2016 20:19:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-any-account-lockout-events-then-filter-by/m-p/205960#M59892</guid>
      <dc:creator>jganger</dc:creator>
      <dc:date>2016-01-05T20:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for any account lockout events, then filter by Active Directory group membership?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-any-account-lockout-events-then-filter-by/m-p/205961#M59893</link>
      <description>&lt;P&gt;You should be able to achieve something similar with the ldap app but I had so many problems (performance, errors, data integrity) when I used it 1 year ago that I gave up and turned to PowerShell + lookups.&lt;/P&gt;

&lt;P&gt;Keep in mind PowerShell has modules for AD and if you use a  CSV file it shouldn't be hard to implement at all.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2016 20:27:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-any-account-lockout-events-then-filter-by/m-p/205961#M59893</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-01-05T20:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for any account lockout events, then filter by Active Directory group membership?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-any-account-lockout-events-then-filter-by/m-p/205962#M59894</link>
      <description>&lt;P&gt;I can definitely handle (and have handled) the powershell export and CSV.  Would you mind giving an example of what the lookup would look like in Splunk?  I'm having a failure of imagination on that part.  &lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2016 21:54:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-any-account-lockout-events-then-filter-by/m-p/205962#M59894</guid>
      <dc:creator>jganger</dc:creator>
      <dc:date>2016-01-05T21:54:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for any account lockout events, then filter by Active Directory group membership?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-any-account-lockout-events-then-filter-by/m-p/205963#M59895</link>
      <description>&lt;P&gt;Sure. It should be something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=domain-infrastructure EventCode=4740
| lookup YOURLOOKUPNAME UserNameInEvent AS UserNameInCSV OUTPUT GroupNameInCSV AS GroupNameInEvent
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Syntax:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;lookup [local=&amp;lt;bool&amp;gt;] [update=&amp;lt;bool&amp;gt;] &amp;lt;lookup-table-name&amp;gt; ( &amp;lt;lookup-field&amp;gt; [AS &amp;lt;event-field&amp;gt;] )... [ OUTPUT | OUTPUTNEW (&amp;lt;lookup-destfield&amp;gt; [AS &amp;lt;event-destfield&amp;gt;] )... ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;More info here: &lt;BR /&gt;
How to use lookups -&amp;gt; &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.2/SearchReference/Lookup"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.2/SearchReference/Lookup&lt;/A&gt;&lt;BR /&gt;
How to configure lookups from GUI -&amp;gt; &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.2/SearchTutorial/Usefieldlookups"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.2/SearchTutorial/Usefieldlookups&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2016 22:13:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-any-account-lockout-events-then-filter-by/m-p/205963#M59895</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-01-05T22:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for any account lockout events, then filter by Active Directory group membership?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-any-account-lockout-events-then-filter-by/m-p/205964#M59896</link>
      <description>&lt;P&gt;Try manually creating a small CSV first with a few users and groups and test it with your events.&lt;BR /&gt;
All the lookup is doing is enriching your event log information by adding a group field to your events.&lt;/P&gt;

&lt;P&gt;The CSV should use a relational schema with a 1 to many mapping (1 user, multiple groups, 1 row per unique User-Group combination):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;USER, GROUP
User1, Group1
User1, Group2
User1, Group3
User2, Group1
User3, Group3
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Jan 2016 22:17:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-any-account-lockout-events-then-filter-by/m-p/205964#M59896</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-01-05T22:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for any account lockout events, then filter by Active Directory group membership?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-any-account-lockout-events-then-filter-by/m-p/205965#M59897</link>
      <description>&lt;P&gt;Perfect!  Thanks so much for your help with this.  One error in your post though, the lookup should be:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;lookup YOURLOOKUPNAME UserNameInCSV AS UserNameInEvent OUTPUT GroupNameInCSV AS GroupNameInEvent
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Jan 2016 14:29:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-any-account-lockout-events-then-filter-by/m-p/205965#M59897</guid>
      <dc:creator>jganger</dc:creator>
      <dc:date>2016-01-06T14:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for any account lockout events, then filter by Active Directory group membership?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-any-account-lockout-events-then-filter-by/m-p/205966#M59898</link>
      <description>&lt;P&gt;Ok, powershell is done, lookup works.   If I'm running the powershell as a scheduled task is there a way to automatically update the lookup table in Splunk?  I'd hate to have to manually update the file every time. &lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2016 14:46:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-any-account-lockout-events-then-filter-by/m-p/205966#M59898</guid>
      <dc:creator>jganger</dc:creator>
      <dc:date>2016-01-06T14:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for any account lockout events, then filter by Active Directory group membership?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-any-account-lockout-events-then-filter-by/m-p/205967#M59899</link>
      <description>&lt;P&gt;Simply overwrite the csv file you are using in your lookup and Splunk will refresh its cache. &lt;/P&gt;

&lt;P&gt;Make sure the operation is transactional, that is, create a temp file first and once you finish writing to it copy it to the destination directory&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2016 15:08:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-any-account-lockout-events-then-filter-by/m-p/205967#M59899</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-01-06T15:08:01Z</dc:date>
    </item>
  </channel>
</rss>

