Splunk Search

Alerting on Failed Login Events

snowmizer
Communicator

I would like to be able to generate an alert whenever there is a failed login using the same account from the same IP where the number of events in a 1 minute period is greater than 2. I tried grouping them by using the "bucket" search command but that doesn't give me the desired results. I also looked at the transaction command but that doesn't seem to do what I want either. If I can get the grouping to work the way I want (group all login failures in a 1m period for the same account and client ip)

Here's a sample of the search I did with the "bucket" command (the table command is just there to see the results generated):

eventtype="windows-security-4771" 
| lookup Service_Account_Lookup sAMAccountName as Account_Name OUTPUT sAMAccountName AS User_Account, AdminAccount 
| where AdminAccount="true" 
| bucket _time span=1m 
| stats count by User_Account 
| rename count AS Login_Attempts 
| table _time, User_Account, Login_Attempts

What's the best way to do this?

0 Karma

gkanapathy
Splunk Employee
Splunk Employee

It's as simple as:

eventtype="windows-security-4771" 
| lookup Service_Account_Lookup 
         sAMAccountName as Account_Name 
  OUTPUT sAMAccountName AS User_Account
         AdminAccount 
| where AdminAccount="true" 
| timechart span=1m 
    count as Login_Attempts
  by User_Account, IP_address
| where Login_Attempts > 2

Your sample query didn't inclue IP_address, so you could just drop it from the above timechart command.

0 Karma

snowmizer
Communicator

Turns out that someone else pointed me to the fact that "transaction" returns two fields duration and eventcount. The eventcount gives me what I want.

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!

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 ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...