Splunk Search

Watchlist Insertion

julirodr
New Member

Hi,

I want put an alert witch detect non authorized connection. In order to do that I have integrate some workstation logs. I want to know what users has been login on these workstations. So, I have 2 recomendations:
- I want target worksation impacted (for example, I want check connection only on HOSTNAME1, HOSTNAME2, HOSTNAME3. Not in HOSTNAME4)
- I want exclude normal user (for example, USER1 is authorized to log in HOSTNAME1)

Do you have any idea on how do to that?


I want to do that:

Event 4624 (Security) AND HOSTNAME IN $WATCHLIST(HOSTNAME) AND USERNAME NOT IN $WATCHLIST(USERNAME)

Thanks for your help.

Regards.

Tags (2)
0 Karma

lguinn2
Legend

I suggest that you build a lookup table to do this. If you haven't used lookup tables, you might want to follow the tutorial to set it up. In the lookup definition, be sure to set the default value to "No Match".

Sample watchlist.csv:

hostname,authorizedUser
host01,userA
host01,userB
host02,userB
host03,userC

Search:

EventCode=4624
| lookup watchlistLookup hostname as host OUTPUT authorizedUsers
| where hostname != ""No Match"
| makemv delim="," authorizedUsers
| where NOT mvfind(authorizedUsers,username) 

Set your alert for "number of events > 0". I am not sure that you actually need the | makemv delim="," authorizedUsers. I also suggest that you try this solution one step at a time, so you can check it for errors and understand better how it works.

0 Karma

lguinn2
Legend

It sounds like a typographical error to me. If you would copy your search string into another comment, then someone might be able to see the problem.

0 Karma

julirodr
New Member

Hello,

Thanks for your help.

This search doesn't work and I don't know why. I have put the search and I have the following error:

Error in 'where' command: Typechecking failed. 'XOR' only takes boolean arguments.

The search job has failed due to an error. You may be able view the job in the Job Inspector.

Do you have any idea about this error?

Thanks,
Regards.

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!

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

Data Management Digest – May 2026

Welcome to the May 2026 edition of Data Management Digest!   As your trusted partner in data innovation, the ...