<?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 AD request and file audit in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/AD-request-and-file-audit/m-p/391406#M69953</link>
    <description>&lt;P&gt;Hello!&lt;/P&gt;

&lt;P&gt;I need to show audit access to a file in Windows, in the context of a certain group in the AD.&lt;/P&gt;

&lt;P&gt;For example: there is a file called file_for_test.doc. To view the latest data on the audit, I use the following code:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host="hostname" sourcetype="WinEventLog" Object_Name="*file_for_test.doc" Accesses="ReadData*" | head 10000 | stats first(_time) as _time by Account_Name,Accesses,EventCode,Object_Name | table _time, Account_Name, Accesses, EventCode, Object_Name 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Result:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_time                 Account_Name   Accesses                      EventCode    Object_Name 
2018-09-25 13:24:07 User_1       ReadData (or ListDirectory)    4663    \Device\file_for_test.doc
2018-09-25 10:59:32 User_2       ReadData (or ListDirectory)    4663    \Device\file_for_test.doc
2018-09-25 08:41:39 User_3       ReadData (or ListDirectory)    4663    \Device\file_for_test.doc
2018-09-24 18:14:33 User_4       ReadData (or ListDirectory)    4663    \Device\file_for_test.doc
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But I need to display data only for users in the certain group AD. For example, only user 1, user 4.&lt;/P&gt;

&lt;P&gt;It's to get a list of these users:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| ldapsearch domain=dom_name search="(&amp;amp;(objectClass=group)(CN=group_name))" | ldapgroup | table member_name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Result:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;member_name
User_1
User_4
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How do I combine 2 of these requests to get the following result:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_time                 Account_Name   Accesses                      EventCode    Object_Name 
2018-09-25 13:24:07 User_1       ReadData (or ListDirectory)    4663    \Device\file_for_test.doc
2018-09-24 18:14:33 User_4       ReadData (or ListDirectory)    4663    \Device\file_for_test.doc
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 29 Sep 2020 21:22:25 GMT</pubDate>
    <dc:creator>zek50618</dc:creator>
    <dc:date>2020-09-29T21:22:25Z</dc:date>
    <item>
      <title>AD request and file audit</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/AD-request-and-file-audit/m-p/391406#M69953</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;

&lt;P&gt;I need to show audit access to a file in Windows, in the context of a certain group in the AD.&lt;/P&gt;

&lt;P&gt;For example: there is a file called file_for_test.doc. To view the latest data on the audit, I use the following code:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host="hostname" sourcetype="WinEventLog" Object_Name="*file_for_test.doc" Accesses="ReadData*" | head 10000 | stats first(_time) as _time by Account_Name,Accesses,EventCode,Object_Name | table _time, Account_Name, Accesses, EventCode, Object_Name 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Result:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_time                 Account_Name   Accesses                      EventCode    Object_Name 
2018-09-25 13:24:07 User_1       ReadData (or ListDirectory)    4663    \Device\file_for_test.doc
2018-09-25 10:59:32 User_2       ReadData (or ListDirectory)    4663    \Device\file_for_test.doc
2018-09-25 08:41:39 User_3       ReadData (or ListDirectory)    4663    \Device\file_for_test.doc
2018-09-24 18:14:33 User_4       ReadData (or ListDirectory)    4663    \Device\file_for_test.doc
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But I need to display data only for users in the certain group AD. For example, only user 1, user 4.&lt;/P&gt;

&lt;P&gt;It's to get a list of these users:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| ldapsearch domain=dom_name search="(&amp;amp;(objectClass=group)(CN=group_name))" | ldapgroup | table member_name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Result:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;member_name
User_1
User_4
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How do I combine 2 of these requests to get the following result:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_time                 Account_Name   Accesses                      EventCode    Object_Name 
2018-09-25 13:24:07 User_1       ReadData (or ListDirectory)    4663    \Device\file_for_test.doc
2018-09-24 18:14:33 User_4       ReadData (or ListDirectory)    4663    \Device\file_for_test.doc
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:22:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/AD-request-and-file-audit/m-p/391406#M69953</guid>
      <dc:creator>zek50618</dc:creator>
      <dc:date>2020-09-29T21:22:25Z</dc:date>
    </item>
    <item>
      <title>Re: AD request and file audit</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/AD-request-and-file-audit/m-p/391407#M69954</link>
      <description>&lt;P&gt;Hello!&lt;BR /&gt;
How to compose a query to search from array?&lt;/P&gt;

&lt;P&gt;I have a dropdown field, in which I choose the needed group.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="dropdown" token="dd01"&amp;gt;
&amp;lt;choice value="ad_group1"&amp;gt;ad_group1&amp;lt;/choice&amp;gt;
&amp;lt;choice value="ad_group2"&amp;gt;ad_group2&amp;lt;/choice&amp;gt;
&amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then we get a table with a list of members of the group&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;query&amp;gt;| ldapsearch domain=dom_name search="(&amp;amp;amp;(objectClass=group)(CN=$dd01$))" | ldapgroup | table member_name&amp;lt;/query&amp;gt;
    &amp;lt;option name="drilldown"&amp;gt;cell&amp;lt;/option&amp;gt;
    &amp;lt;drilldown&amp;gt;
      &amp;lt;set token="mem_name"&amp;gt;$row.member_name$&amp;lt;/set&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How to compose a query "where" or any other that will search for an array of users in it?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;query&amp;gt;
host="hostname" sourcetype="WinEventLog" Object_Name="*filename.doc" Accesses="ReadData*" 
| head 1000 
**| where Account_Name = $mem_name$**
| table _time, Account_Name, Accesses, EventCode, Object_Name 
&amp;lt;/query&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 Oct 2018 02:54:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/AD-request-and-file-audit/m-p/391407#M69954</guid>
      <dc:creator>zek50618</dc:creator>
      <dc:date>2018-10-01T02:54:06Z</dc:date>
    </item>
  </channel>
</rss>

