Splunk Search

Alert to trigger secondary search

gdavid
Path Finder

Is there any easy way for an alert to trigger another search?

my use case is for an account lockout to trigger a search for failed login attempts for that account, so i do want to pass in some result variables. it looks like i can do this with $result.field$, but not sure if i need to write my own script for this or if there is an easier way.

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Here's a rough untested idea of how to merge the two searches:

  (eventtype=msad-account-lockout out) OR (eventtype="msad-failed-user-logons" EventCode=4625)
| stats values(eventtype) as et values(displayName) values(email) ... values(src) values(src_ip) ... by user
| search et=msad-account-lockout

That'll effectively join the two eventtypes together by user, and only return users that actually had a lockout in the realtime search window.

0 Karma

gdavid
Path Finder

Right now the workflow is realtime alert on this search:

Lockout Alert:

eventtype=msad-account-lockout out | lookup AD_Users_Lookup sAMAccountName as user | table _time, displayName, user, email, telephoneNumber, mobile, pwdLastSet, description, Caller_Computer_Name, dest_nt_host   | rename  Caller_Computer_Name as "Occurred On", mobile as "Mobile Phone", telephoneNumber as "Phone", user as "UserID", pwdLastSet as "Password Changed On", signature as "Action", description as Description, dest_nt_host as "Reported By" 

The secondary search that I'm thinking about looping in is:
Why it locked out, but may come back with multiple results if they try on different PCs (src):

eventtype="msad-failed-user-logons" EventCode=4625 | table user, src, src_ip, EventCodeDescription, dest
0 Karma

martin_mueller
SplunkTrust
SplunkTrust

You might be able to roll this into one alerting search.

0 Karma

woodcock
Esteemed Legend

I agree; you can almost certainly do this with a single search (which could then be split into 2 if you like). Give the details and I am sure we can construct a framework for this.

0 Karma
Get Updates on the Splunk Community!

Accelerating Observability as Code with the Splunk AI Assistant

We’ve seen in previous posts what Observability as Code (OaC) is and how it’s now essential for managing ...

Integrating Splunk Search API and Quarto to Create Reproducible Investigation ...

 Splunk is More Than Just the Web Console For Digital Forensics and Incident Response (DFIR) practitioners, ...

Congratulations to the 2025-2026 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...