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
    # Setting Up Splunk Universal Forwarder on Windows and Linux for your home lab ![image](https://hackmd.io/_uploads/SymLf_Usbx.png) A Splunk Forwarder is a lightweight agent installed on data-generating hosts to collect, tag, and securely stream data (logs, metrics) to a central Splunk Indexer.This guide will walk you through the process of setting up the Splunk Universal Forwarder on Linux and Windows,connecting it to your Splunk server for log collection and centralized analysis purposes. ## I. Types of forwarders There are three types of forwarders: - The universal forwarder contains only the components that are necessary to forward data. - A heavy forwarder is a full Splunk Enterprise instance that can index, search, and change data as well as forward it. The heavy forwarder has some features disabled to reduce system resource usage. - A light forwarder is also a full Splunk Enterprise instance, with more features disabled to achieve as small a resource footprint as possible. The light forwarder has been deprecated as of Splunk Enterprise version 6.0. The universal forwarder supersedes the light forwarder for nearly all purposes and represents the best tool for sending data to indexers. ## II. Requirements In this article,your home lab requires: - A Windows machine (10/11) - A Linux machine - A [Splunk server](https://www.splunk.com/en_us/products/splunk-enterprise.html) has been already deployed ## III. Steps ### Step 1: Downloading installation package Visit official [Splunk website](https://www.splunk.com/?locale=en_us),create an account and navigate to Universal Forwarder ![image](https://hackmd.io/_uploads/ByFmOdLiWx.png) Choose the corresponding version to your machine.You can download the installation package directly from this website or copy `wget` command and paste it to your terminal ![image](https://hackmd.io/_uploads/Bkyx9uUsZg.png) ![image](https://hackmd.io/_uploads/rkKdDtIiZg.png) You can also choose other package versions by clicking on Previous Releases ### Step 2: Installing Universal Forwarder There are 2 ways to install Universal Forwarder on your machine.The first way is install via command-line,this way is working on both Linux and Windows.The second is via GUI but it is only working on Windows. In the following instructions I will show you both. #### On Linux - Use this `tar` command to unpack the `.tgz` file : `tar -xvzf "file_name"`.The instruction of using tar command is [here](https://) (If you install `.rpm` file you need to use 7z or rpm2cpio command-line utilities to unpack it) - Before installing the program you need to know these common command in this directory`/home/username/splunkforwarder/bin`: -- start: to start the Forwarder -- stop: to stop the Forwarder -- restart: to restart the Forwarder -- status: to check the status of the Forwarder - Start the Forwarder with this command `./splunk start --accept-license` (use accept-license parameter to automatically accept license) - Enter the admin name and password ![image](https://hackmd.io/_uploads/H1gYQqLi-e.png) - Check the status of the forwarder to ensure it is running correctly with this command `./splunk status` ![image](https://hackmd.io/_uploads/H1PlH9UoZx.png) #### on Windows - Click on the `.msi` file - Accept the license,in this home lab I will deploy Splunk forwarder on our own machine so choose on-premise option ![image](https://hackmd.io/_uploads/B17dfkLnbg.png) - Enter the username and password ![image](https://hackmd.io/_uploads/HyLaMkLnWe.png) - I will use a Splunk Receiving Indexer as the Splunk server so skip the Deployment Server and enter IP address and port number for the Indexer(the server will listen on this port) ![image](https://hackmd.io/_uploads/S1vu71I2-x.png) ![image](https://hackmd.io/_uploads/rkzIryL3Ze.png) >[!Note] Note: > - If you choose Customize Options you can config some basic log collecting options.The following section provides a detailed guide on configuring Splunk Universal Forwarder log collection by editing inputs.conf ![image](https://hackmd.io/_uploads/S1BxP1U2be.png) > - Learn more about Splunk Deployment Server [here](https://help.splunk.com/en/splunk-enterprise/administer/update-your-deployment/9.4/deployment-server-and-forwarder-management/deployment-server-architecture) and how to config it properly [here](https://www.youtube.com/watch?v=2Ba_9kebof0&t=566s) ### Step 3: Configuring collecting and forwarding settings From now on,configurations on both windows and linux are the same.You can either config with command-line or using any text editors to modify `.conf` files. Be careful when modifying those text files because you won't receive any error messages if your syntax is wrong. 1.Config `inputs.conf` file This file on a Splunk Forwarder defines what data is collected and how it is sent to the Indexer. Navigate to `$SPLUNK_HOME/etc/apps/search/local` and open `inputs.conf`.Here are some common spec: - disabled = <boolean> : whether or not the input is enabled,default value is 0 (enable) - index = <string> : specifies the index where this input sends the data (optional),default value is the.Note that if you config a index in this file but that index hasn't been created on splunk server,the server will drop all the data in this input,default index (in most cases the default index is main) - host = <string> : sets the hostname of executing machine,default value is "$decideOnStartup" - renderXml = <boolean> : whether or not the input returns the event data in XML (eXtensible Markup Language) format or in plain text,default value is false - start_from = <oldest|newest> : how the input should chronologically read the Event Log channels,default value is "oldest" - current_only = <boolean> : whether or not to acquire only events that arrive while the instance is running,default value is 0 (false) - checkpointInterval = <integer> : how often, in seconds, that the Windows Event Log input saves a checkpoint(checkpoints store the eventID of acquired events.This lets the input continue monitoring at the correct event after a shutdown or outage),default value is 0 Examples: ``` [WinEventLog://Security] checkpointInterval = 5 current_only = 0 disabled = 0 start_from = oldest [WinEventLog://Microsoft-Windows-Sysmon/Operational] disabled = 0 host = smith index = Sysmon renderXml = true start_from = oldest ``` 2.Config Forwarding Settings The Forwarder needs to know where to send the data. You can configure this by navigating to `$SPLUNK_HOME/bin` and running this command: ``` ./splunk add forward-server <indexer_ip_or_hostname>:<port> ``` the default port is 9997(the Indexer will listen on this port to receive data from Forwarder) You can also modify `outputs.conf` file to define the destination 3.Config listening port on Splunk Server Via Splunk web,navigate to Settings -> Forwarding and receiving -> Configure receiving and click "New Receiving Port" ![image](https://hackmd.io/_uploads/Bkki44L2bg.png) Enter the port number and save >[!NOTE] Note: > You can modify other `.conf` files to manage data collection, routing, and server connections. These files are primarily stored in `$SPLUNK_HOME/etc/system/local/`. > Visit [this link](https://help.splunk.com/en/data-management/splunk-enterprise-admin-manual/9.1/configuration-file-reference/9.1.9-configuration-file-reference) for more configurations. ### Step 4: Testing the Setup - On Splunk Web interface,go to the Search & Reporting app to check whether the Server received logs or not ![image](https://hackmd.io/_uploads/rJcyj4I3-x.png) - If you don’t see any data coming from the Forwarder, check the logs on the Splunk Forwarder for any issues by navigating to `$SPLUNK_HOME\var\log\splunk\splunkd.log`.Look for any warnings or errors that might indicate issues with the connection. - If you deploy the splunk server on a Windows machine you will need to config firewall rules to unblock incoming data on the listening port. ## Conclusion By following this guide, you have successfully deployed the Splunk Universal Forwarder across both Windows and Linux environments. Centralizing your logs is a critical first step in gaining visibility into your infrastructure. From here, you can begin creating custom dashboards and alerts in Splunk Enterprise to monitor your systems effectively.

    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