Start your 14-day free trial today & Get 20% Off All Annual Managed ELK Plans

No Credit Card Required

Try Logit.io Free

Already have an account? Sign In

Send data via Sysmon to your Logstash instance provided by Logit.io

Windows Sysmon

A log shipper designed for files.

Configure Winlogbeat to ship Sysmon event logs to Logstash and Elasticsearch.

Step 1 - Install SysmonCopy

Download the sysmon package from Microsoft link below.

https://docs.microsoft.com/en-us/sysinternals/downloads/sysmon

Extract the files to C:\Program Files\Sysmon

Now open Powershell as Administrator and change directory to the extracted files.

cd 'C:\Program Files\Sysmon\'

Now run:

.\sysmon.exe -i -accepteula -l -n

What have I just done?

-i : Install Sysmon (Optionally take a configuration file)
-l : Log loading of modules
-n : Log network connections

If installed correctly you should see:

System Monitor v13.01 - System activity monitor
Copyright (C) 2014-2021 Mark Russinovich and Thomas Garnier
Sysinternals - www.sysinternals.com

Sysmon installed.
SysmonDrv installed.
Starting SysmonDrv.
SysmonDrv started.
Starting Sysmon..
Sysmon started.

Step 2 - Install WinlogbeatCopy

  • Download the Winlogbeat Windows zip file from the official downloads page.

  • Extract the contents of the zip file into C:\Program Files.

  • Rename the winlogbeat-<version> directory to Winlogbeat.

  • Open a PowerShell prompt as an Administrator (right-click the PowerShell icon and select Run As Administrator). If you are running Windows XP, you may need to download and install PowerShell.

  • Run the following commands to install Winlogbeat as a Windows service:

    PS C:\Users\Administrator> cd 'C:\Program Files\Winlogbeat'
    PS C:\Program Files\Winlogbeat> .\install-service-winlogbeat.ps1
    
    Security warning
    Run only scripts that you trust. While scripts from the internet can be useful,
    this script can potentially harm your computer. If you trust this script, use
    the Unblock-File cmdlet to allow the script to run without this warning message.
    Do you want to run C:\Program Files\Winlogbeat\install-service-winlogbeat.ps1?
    [D] Do not run  [R] Run once  [S] Suspend  [?] Help (default is "D"): R
    
    Status   Name               DisplayName
    ------   ----               -----------
    Stopped  winlogbeat         winlogbeat
    
    If script execution is disabled on your system, you need to set the execution policy for the current session to allow the script to run. For example: PowerShell.exe -ExecutionPolicy UnRestricted -File .\install-service-winlogbeat.ps1

Step 3 - Configure WinlogbeatCopy

Configuration for Winlogbeat is found in the winlogbeat.yml file in C:\Program Files\Winlogbeat.

In the event_logs section, specify the event logs that you want to monitor. By default, Winlogbeat is set to monitor application, security, and system logs. You need to add an additional section to collect the symon logs edit the config file to match below.

    winlogbeat.event_logs:
     - name: Application
     - name: Security
     - name: System
     - name: Microsoft-windows-sysmon/operational
       tags: [sysmon]

This will collect the sysmon logs and appropriately tag them with 'sysmon' making them easy to find.

To obtain a list of available event logs, run Get-EventLog *

Step 4 - Configure outputCopy

We'll be shipping to Logstash so that we have the option to run filters before the data is indexed.
Comment out the elasticsearch output block.

## Comment out elasticsearch output
#output.elasticsearch:
#  hosts: ["localhost:9200"]
No input available! Your stack is missing the required input for this data source Talk to support to add the input

Step 5 - Validate configurationCopy

Let's check the configuration file is syntactically correct.

PS C:\Program Files\Winlogbeat> .\winlogbeat.exe test config -c .\winlogbeat.yml -e

Step 6 - Start winlogbeatCopy

Ok, time to start ingesting data!

PS C:\Program Files\Winlogbeat> Start-Service winlogbeat

Winlogbeat should now be running. If you used the configuration described here, then you can view the log file at C:\ProgramData\winlogbeat\Logs\winlogbeat.

You can view the status of the service and control it from the Services management console in Windows. To launch the management console, run this command:

PS C:\Program Files\Winlogbeat> services.msc

Step 7 - Stopping winlogbeatCopy

Stop the Winlogbeat service with the following command:

PS C:\Program Files\Winlogbeat> Stop-Service winlogbeat
Toggle View

Expand View

Return to Search