duy Nguyen duy
  • NEW!
    NEW!  Connect Ideas Across Notes
    Save time and share insights. With Paragraph Citation, you can quote others’ work with source info built in. If someone cites your note, you’ll see a card showing where it’s used—bringing notes closer together.
    Got it
      • Create new note
      • Create a note from template
        • Sharing URL Link copied
        • /edit
        • View mode
          • Edit mode
          • View mode
          • Book mode
          • Slide mode
          Edit mode View mode Book mode Slide mode
        • Customize slides
        • Note Permission
        • Read
          • Only me
          • Signed-in users
          • Everyone
          Only me Signed-in users Everyone
        • Write
          • Only me
          • Signed-in users
          • Everyone
          Only me Signed-in users Everyone
        • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invite by email
        Invitee

        This note has no invitees

      • Publish Note

        Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

        Your note will be visible on your profile and discoverable by anyone.
        Your note is now live.
        This note is visible on your profile and discoverable online.
        Everyone on the web can find and read all notes of this public team.

        Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

        Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

        Explore these features while you wait
        Complete general settings
        Bookmark and like published notes
        Write a few more notes
        Complete general settings
        Write a few more notes
        See published notes
        Unpublish note
        Please check the box to agree to the Community Guidelines.
        View profile
      • Commenting
        Permission
        Disabled Forbidden Owners Signed-in users Everyone
      • Enable
      • Permission
        • Forbidden
        • Owners
        • Signed-in users
        • Everyone
      • Suggest edit
        Permission
        Disabled Forbidden Owners Signed-in users Everyone
      • Enable
      • Permission
        • Forbidden
        • Owners
        • Signed-in users
      • Emoji Reply
      • Enable
      • Versions and GitHub Sync
      • Note settings
      • Note Insights New
      • Engagement control
      • Make a copy
      • Transfer ownership
      • Delete this note
      • Save as template
      • Insert from template
      • Import from
        • Dropbox
        • Google Drive
        • Gist
        • Clipboard
      • Export to
        • Dropbox
        • Google Drive
        • Gist
      • Download
        • Markdown
        • HTML
        • Raw HTML
    Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
    Create Create new note Create a note from template
    Menu
    Options
    Engagement control Make a copy Transfer ownership Delete this note
    Import from
    Dropbox Google Drive Gist Clipboard
    Export to
    Dropbox Google Drive Gist
    Download
    Markdown HTML Raw HTML
    Back
    Sharing URL Link copied
    /edit
    View mode
    • Edit mode
    • View mode
    • Book mode
    • Slide mode
    Edit mode View mode Book mode Slide mode
    Customize slides
    Note Permission
    Read
    Only me
    • Only me
    • Signed-in users
    • Everyone
    Only me Signed-in users Everyone
    Write
    Only me
    • Only me
    • Signed-in users
    • Everyone
    Only me Signed-in users Everyone
    Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Creating Splunk Alerts ![image](https://hackmd.io/_uploads/HJM4Zj22bx.png) This article demonstrates how to create detection alerts in Splunk. We will focus on: - Understanding components and functions of Alerts. - Configuring Alert's settings. - Creating sample Alerts based on real-world SOC use cases. ### What are Alerts in Splunk ? Alerts in Splunk are specialized saved searches that monitor for specific events, such as error thresholds or security threats, in real time or on a schedule. When defined conditions are met, they trigger actions like sending emails, running scripts, or creating incidents to notify users and initiate responses. Besides, Alert is a knowledge object in Splunk. For more information about knowledge object,see this [doc](https://docs.splunk.com/Splexicon:Knowledgeobject). ### Key Aspects of Splunk Alerts: #### Alert Types: - Scheduled: Runs the search at defined intervals (e.g., every hour, daily). - Real-time: Monitors data continuously, allowing immediate detection of issues, which is often used in SOC scenarios. #### Trigger Conditions: Set up to trigger every time a result is found or when specific thresholds are met (e.g., error count > 5 in 1 minute) #### Actions: When triggered, alerts can send emails, run scripts, or populate the Triggered Alerts page. #### Throttling: Limits the number of alerts triggered over a period to prevent alert fatigue ## I.Steps First, you need to create a Search query identifying specific logs that you want to monitor.Here are some Examples: ``` index=windows EventCode=4625 | stats count by user | where count > 5 ``` ``` index=sysmon EventCode=1 | search Image="*powershell.exe" ``` #### Step 1: To save your query as an Alert,run it,click on "Save As" and select "Alert" ![image](https://hackmd.io/_uploads/rkooMc33Wg.png) #### Step 2: In the "Save As Alert" dialog,config the following settings ![image](https://hackmd.io/_uploads/Hyl4h4cnhZg.png) ##### Title: Give your Alert a descriptive name(e.g.,PowerShell detected,Failed Login Attempts - Windows Servers,...) ##### Description: Optionally,you can add description to provide more context about your Alert. ##### Permissions: There are two options - Private: Makes the alert private to the alert creator - Shared in App: Display the alert for all users of the app. See this [doc](https://help.splunk.com/en/splunk-enterprise/manage-knowledge-objects/knowledge-management-manual/10.2/get-started-with-knowledge-objects/manage-knowledge-object-permissions) for more knowledge object permissions. ##### Alert type: Splunk has two Alert types - Scheduled: Use a scheduled alert to search for events on a regular basis and monitor whether they meet specific conditions. A scheduled alert is useful if immediate or real-time monitoring is not a priority. - Real-time: Real-time alerts search for events continuously. They can be useful in situations where immediate monitoring and responses are important. You can use real-time alerts that trigger once per result or only if certain conditions are met within a specific rolling time window.Rolling time window known as a "rolling window alert" is a continuous, moving interval applied to real-time alerts or searches. It calculates metrics or triggers alerts based on data that constantly updates—adding new data while discarding old data as time passes. This is used to detect patterns over a specific recent duration(e.g.5 failed logins within 10 minutes) ##### Expires: Determines how long the alert results remain accessible in the system after they are generated. ##### Trigger Conditions: Your Alert does not have to trigger everytime the search results appear,trigger conditions are used to monitor patterns in event data or prioritize specific events ![image](https://hackmd.io/_uploads/BkOQc7BTbl.png) ##### Trigger: There are two options - Once: The Alert will trigger once the threhold is reached. - For each result: The Alert will trigger for every matching result. ##### Throttle: Suppresses redundant notifications by pausing alerts for a specified period when specific field values reoccur,prevents alert fatigue and allows you to limit notifications.Throttle can be applied to both scheduled and real-time alerts.Especially for real-time searches, it is highly recommended to apply throttle to avoid excessive noise. ##### Trigger Actions: This setting helps you respond to trigger Alerts.You can enable more than one actions - Email notification action: Sending email notifications when alerts trigger - Use a webhook alert action: Displaying a message in a chat room or updating another web resource - Output results to a CSV lookup: Writing the results of the triggered alert or scheduled report to a CSV lookup file - Log events: Logging and indexing searchable alert events - Monitor triggered alerts: Adding an alert to a list of recently triggered alerts for monitoring - Send alerts and dashboards to Splunk Mobile users: Sending an alert to Splunk Mobile users After configuring the settings above,clink "Save" to create your Alert. #### Step 3: To edit your Alerts after creating them,go to "Searches, reports, and alerts" in the "Settings" section ![image](https://hackmd.io/_uploads/rygW38vpbx.png) Click on the "Edit" drop down arrow ![image](https://hackmd.io/_uploads/HkgDn8waZx.png) - Choose "Edit Alert" to edit the settings mentioned in step 2 - Choose "Edit Permissions" to edit your Alert's permissions which define who can read and modify it ![image](https://hackmd.io/_uploads/SJPy0UPaWx.png) ## II.Examples ### 1. SSH brute-force Alert In this section,we will use this query to identify signs of SSH brute-force attacks. In reality,attackers often perform brute-force attacks by repeatedly attempting SSH authentication.This alert helps SOC analysts identify potential unauthorized access attempts and take appropriate response actions by monitoring for a high number of failed login attempts within a short time frame ``` index="linux_auth_log" source="/var/log/auth.log" ("Failed password" OR "invalid user") | rex "(?<user>[\w]+) from (?<src_ip>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})" | bin _time span=5m | stats min(_time) as firstTime max(_time) as lastTime count by user, src_ip | where count > 10 | convert ctime(firstTime) | convert ctime(lastTime) ``` Explanation: - Use `rex` command to extract users and source IP from raw logs - Use `bin` command with `_time` and `span=5m` parameters to group events into 5-minute buckets to show activity over time - Use `stats` command with `by` clause to create a data table - Use `convert ctime` command to convert `first/lastTime` field to a human-readable string With the settings: Setting | Value| |----------------------|-----------------------| |Cron Schedule |0 * * * * | |Earliest Time | -70m@m | |Latest Time | -10m@m | |Schedule Window | auto | |Trigger conditions| Number of results is greater than 0| |Throttle: Supress triggering for| 60 minutes| |Trigger Actions | Add to Triggered Alerts| See the result ![Screenshot 2026-04-24 174040](https://hackmd.io/_uploads/rkgZnpOTbe.png) ### 2.Windows PowerShell Script Block With Malicious String The following Alert detects the execution of PowerShell scripts containing Base64 encoded content. It filters events which have fields that contain specific strings. ``` index= winsysmon EventCode=1 Image="*powershell.exe" CommandLine = "*EncodedCommand*" | table _time host user Image CommandLine ParentImage ``` Explanation: - `table` is a command used to format search results into a clean, tabular format the settings are the same as the previous example.See the result ![Screenshot 2026-04-25 003323](https://hackmd.io/_uploads/rJuG1NFTWg.png) >[!NOTE] Note: >This detection may generate false positives if users intend to use encoded commands. >This Alert will not trigger if attackers instead of using fully spelled out `-EncodedCommand` parameter,they use `-eNcO` or `-e^N^c^O` which the regex in this Alert won't catch. Visit [Splunk documentation](https://help.splunk.com/en/splunk-enterprise/search/spl-search-reference/9.0/quick-reference/commands-by-category) for more information about Splunk commands and [Splunk Security Content](https://research.splunk.com/) for real-world Alert queries.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully