top of page
  • Writer's pictureotw

Splunk for Security Monitoring, Part 3: Creating a Real-Time Alert

Updated: Dec 30, 2022

Welcome back, my aspiring cyber warriors!

In earlier posts here at Hackers-Arise, I introduced you to Splunk, an excellent tool for managing all your machine-generated data.

In this tutorial, I will show you how to use Splunk to generate real-time alerts on just about any machine-data condition that arises on your system or network.

Splunk alerts can be created based upon any search that you can create in the Search window (see Splunk SPL). The alerts will then be triggered when the search results condition are met, much like an IDS creates alerts on signatures (see Snort Rule Writing). These alerts can;

  1. Create an entry in Triggered alerts

  2. Log an event

  3. Output results to a lookup file

  4. Send emails

  5. Use a Webhook

  6. Perform a custom action

Here we will create a real-time alert that emails us whenever a privileged account is used.

Step #1: Create A Search

The first step is to create a search condition. In this case, we have created a search among the Security and System event logs for EventCode=4672 (this event code is triggered whenever anyone or any service logs on with with administrator rights on Windows 7/2008 through Windows 2019 systems).

First, we need to create the search. To find all EventCode=4672, we can create a search such as;

(source="WinEventLog:Security" OR source="WinEventLog:System") | where EventCode=4672

Next, we click on the "Save As" tab in the upper right corner. When we click on "Alert", it open a window like that below. Go ahead and give your Alert a name (I named mine "EventCode 4672 Alert") in the Title space and then add a Description.

Just below the Description, you will see the "Permissions". If you set it to Private, only you can access, edit and view the alerts. If you choose "Shared in App" others can view the alerts through the shared app. Here, I chose my alerts to be private.

Step #2: Scheduled vs. Real-Time

On the next line we can choose either a Scheduled alert or a Real time alert. Here I select a Real-Time alert.

The next line is the "Trigger Conditions". These allow you to capture a larger data set and then apply additional conditions to the results before the alert is triggered. For instance, you may want to see more than one occurrence of the condition within a specified time period before triggering the alert.

These per result conditions include;

  1. Per-Result

  2. Number of Results

  3. Number of Hosts

  4. Number of Sources

  5. Custom

Here we set the Per-Result condition to 3 results per minute.

Step #3: Set the Action

In the final step, we determine what action we want the alert to take. These actions include;

  1. Log the Event

  2. Output the results t lookup

  3. Output results to Telemetry endpoint

  4. Run a script

  5. Send email

  6. Webhook

Here I want to set the alert to send an email. When you go to save the alert you will be asked for;

  1. Who to send the alert to;

  2. Priority

  3. Subject

  4. Message

  5. Type of Message (HTML or Plain Text)

Finally, when you save the alert, you will be greeted with a result like that below.

Now, whenever your search condition is triggered more than 3 times in one minute, Splunk will email an alert notifying you.


Splunk is an excellent and powerful tool for security monitoring. Not only does it gather and index all your machine data, but it has the capability to be used much like an intrusion detection system (IDS), if you know what to look for. While your IDS is looking for signatures of malware, your Splunk instance can be looking for behaviors that indicate suspicious activity and notify you in real-time!

2,829 views1 comment

Recent Posts

See All

1 comentario

03 ene 2023

Do you suspect your spouse of cheating, are you being overly paranoid or seeing signs of infidelity…Then he sure is cheating: I was in that exact same position when I met Henry through my best friend James who helped me hack into my boyfriend’s phone, it was like a miracle when he helped me clone my boyfriend’s phone and I got first-hand information from his phone. Now I get all his incoming and outgoing text messages, emails, call logs, web browsing history, photos and videos, instant messengers(facebook, whatsapp, bbm, IG etc) , GPS locations, phone taps to get live transmissions on all phone conversations. if you need help contact his gmail on ,, and you can also , whatsap…

Me gusta
bottom of page