Getting Data In

AD request and file audit

zek50618
New Member

Hello!

I need to show audit access to a file in Windows, in the context of a certain group in the AD.

For example: there is a file called file_for_test.doc. To view the latest data on the audit, I use the following code:

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 

Result:

_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

But I need to display data only for users in the certain group AD. For example, only user 1, user 4.

It's to get a list of these users:

| ldapsearch domain=dom_name search="(&(objectClass=group)(CN=group_name))" | ldapgroup | table member_name

Result:

member_name
User_1
User_4

How do I combine 2 of these requests to get the following result:

_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
0 Karma

zek50618
New Member

Hello!
How to compose a query to search from array?

I have a dropdown field, in which I choose the needed group.

<input type="dropdown" token="dd01">
<choice value="ad_group1">ad_group1</choice>
<choice value="ad_group2">ad_group2</choice>
</input>

Then we get a table with a list of members of the group

<query>| ldapsearch domain=dom_name search="(&amp;(objectClass=group)(CN=$dd01$))" | ldapgroup | table member_name</query>
    <option name="drilldown">cell</option>
    <drilldown>
      <set token="mem_name">$row.member_name$</set>

How to compose a query "where" or any other that will search for an array of users in it?

<query>
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 
</query>
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...

SplunkTrust Application Period is Officially OPEN!

It's that time, folks! The application/nomination period for the 2026-2027 SplunkTrust is officially open. If ...