Splunk Enterprise

how to detect non team member logon a team workstation?

samlinsongguo
Communicator

I have a list contain all team members name and windows workstation logon event is collected in Splunk. Could anyone give me an idea about how can I alert if any user logon that workstation is not belong to the team?

Tags (1)
0 Karma
1 Solution

aakwah
Builder

Hello,

Nice use case, you can achieve this by defining a CSV lookup.

The CSV file will have 2 columns, the first one is member name and the second one is Membership status, something like that:

user, membership_status
User1,Yes
User2,Yes
User3,Yes
User4,Yes

Your events should include the user filed (first coulmn header).

Define the lookup in in transforms.conf

[Team_Members_lookup]
filename = team_members.csv
default_match = No

CSV file location:

/lookups/team_members.csv

You search query can be like this:

sourcetype=winlogs | lookup Team_Members_lookup user OUTPUT membership_status | search dest_machine=Serv123 membership_status=No

This lookup enriches the logs with a new field membership_status, its value will be "Yes" if the user is on the csv file otherwise it will be "No"

You can add the lookup to props.conf to be applied automatically on a certain sourcetype, and in this case you don't need to put "lookup Team_Members_lookup user OUTPUT membership_status" in your query, but it may have some performance impact as the lookup is applied in all searches.

Regards

View solution in original post

0 Karma

dineshraj9
Builder

Have the list of members in a lookup and then form a query like this -

Lookup -

teammembers_lookup.csv 
user,status
user1,active
user2,active

Query -

sourcetype="WinEventLog:Security" eventtype="msad-successful-user-logons" | stats count by user | lookup teammembers_lookup.csv user OUTPUT status | fillnull value="-" status | search status!="active"
0 Karma

aakwah
Builder

Hello,

Nice use case, you can achieve this by defining a CSV lookup.

The CSV file will have 2 columns, the first one is member name and the second one is Membership status, something like that:

user, membership_status
User1,Yes
User2,Yes
User3,Yes
User4,Yes

Your events should include the user filed (first coulmn header).

Define the lookup in in transforms.conf

[Team_Members_lookup]
filename = team_members.csv
default_match = No

CSV file location:

/lookups/team_members.csv

You search query can be like this:

sourcetype=winlogs | lookup Team_Members_lookup user OUTPUT membership_status | search dest_machine=Serv123 membership_status=No

This lookup enriches the logs with a new field membership_status, its value will be "Yes" if the user is on the csv file otherwise it will be "No"

You can add the lookup to props.conf to be applied automatically on a certain sourcetype, and in this case you don't need to put "lookup Team_Members_lookup user OUTPUT membership_status" in your query, but it may have some performance impact as the lookup is applied in all searches.

Regards

0 Karma

samlinsongguo
Communicator

HI
Thank you for your answer, but when I do
sourcetype=winlogs | lookup Team_Members_lookup user OUTPUT membership_status
it doesnt return me anything. and I found the lookup does add the value to the event, do you know why is that?
Cheers

0 Karma

aakwah
Builder

Hello,
Welcome.

The first column name in CSV file should have the field name that contains the username.

please provide the following details about your logs:
Sourcetype
Filed name that contains the user name
Column names of CSV file
Field name that contains machine name

Regards,

0 Karma
Get Updates on the Splunk Community!

Best Strategies to Optimize Observability Costs

 Join us on Tuesday, May 6, 2025, at 11 AM PDT / 2 PM EDT for an insightful session on optimizing ...

Fueling your curiosity with new Splunk ILT and eLearning courses

At Splunk Education, we’re driven by curiosity—both ours and yours! That’s why we’re committed to delivering ...

Splunk AI Assistant for SPL 1.1.0 | Now Personalized to Your Environment for Greater ...

Splunk AI Assistant for SPL has transformed how users interact with Splunk, making it easier than ever to ...