Get a DemoStart Free TrialSign In

Windows Winlogbeat Setup

Use Logstash with Windows to ship logs to Elasticsearch & Kibana

Winlogbeat is a Windows specific event-log shipping agent installed as a Windows service. It can be used to collect and send event logs to one or more destinations, including Logstash.

Send Your DataLogsOperating SystemsWindows Winlogbeat Setup Guide

Follow this step by step guide to get 'logs' from your system to Logit.io:

Step 1 - Install Winlogbeat

To get started you will need to install winlogbeat. To do this you have two main options:

To successfully install winlogbeat and set up the required Windows service you will need to have administrator access.

If you have chosen to download the zip file:

  • Extract the contents of the zip file into C:\Program Files.
  • Rename the extracted folder to winlogbeat
  • Open a PowerShell prompt as an Administrator (right-click the PowerShell icon and select Run As Administrator).
  • From the PowerShell prompt, run the following commands to install winlogbeat as a Windows service:
cd 'C:\Program Files\winlogbeat'
.\install-service-winlogbeat.ps1

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

For more information about Powershell execution policies see here

If you have chosen to download the winlogbeat.msi file:

  • double-click on it and the relevant files will be downloaded.

At the end of the installation process you'll be given the option to open the folder where winlogbeat has been installed.

  • Open a PowerShell prompt as an Administrator (right-click the PowerShell icon and select Run As Administrator).
  • From the PowerShell prompt, change directory to the location where winlogbeat was installed and run the following command to install winlogbeat as a Windows service:
.\install-service-winlogbeat.ps1

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

For more information about Powershell execution policies see here

Step 2 - Update your configuration file

The configuration file below is pre-configured to send data to your Logit.io Stack via Logstash.

Note: Please make sure the 'hosts' field in the Logstash outputs section is correctly populated. If you are logged into your Logit.io account the 'hosts' field should have been pre-populated with the correct values.

Copy the configuration file below (making the above changes as necessary) and overwrite the contents of winlogbeat.yml. (If you used the installer program to install winlogbeat the winlogbeat.yml file may not exist so you'll need to create it and add the details below).

###################### Logit.io Winlogbeat Configuration ########################
# ============================== Winlogbeat specific options ==============================
winlogbeat.event_logs:
- name: Application
  ignore_older: 72h

- name: System

- name: Security

- name: Microsoft-Windows-Sysmon/Operational
  tags: [sysmon]

- name: Windows PowerShell
  event_id: 400, 403, 600, 800

- name: Microsoft-Windows-PowerShell/Operational
  event_id: 4103, 4104, 4105, 4106

- name: ForwardedEvents
  tags: [forwarded]    

fields:
  type: wineventlog

fields_under_root: true  

# ================================== Outputs ===================================
# ------------------------------ Logstash Output -------------------------------
output.logstash:
  hosts: ["your-logstash-host:your-ssl-port"]
  loadbalance: true
  ssl.enabled: true

  pipeline: "winlogbeat-%{[agent.version]}-routing"

# ================================= Processors =================================
processors:
  - add_host_metadata:
      when.not.contains.tags: forwarded
  - add_cloud_metadata: ~

Step 3 - Validate configuration

From the PowerShell prompt, (in the directory where winlogbeat was installed) and run the following command to validate your configuration file:

.\winlogbeat.exe test config -c .\winlogbeat.yml -e
If the yml file is valid, winlogbeat will print `Config OK`. If there's a problem you should get an error message with details of the error.

Step 4 - Start winlogbeat

From the PowerShell prompt, (in the directory where winlogbeat was installed) run the following command:

Start-Service winlogbeat

Step 5 - Check Logit.io for your logs

Data should now have been sent to your Stack.

View my data

If you don't see logs take a look at How to diagnose no data in Stack below for how to diagnose common issues.

Step 6 - how to diagnose no data in Stack

If you don't see data appearing in your Stack after following the steps, visit the Help Centre guide for steps to diagnose no data appearing in your Stack or Chat to support now.

Step 7 - Windows Centralised Logging Overview

Centralized logging can provide several benefits for Windows environments, including:

Improved visibility: By consolidating all logs from various Windows machines into a central location, it becomes easier to see what's happening across the entire infrastructure. This can help with troubleshooting, identifying security threats, and monitoring system health.

Simplified management: Instead of having to access logs on each individual Windows machine, administrators can manage logs from a single location. This can save time and reduce complexity.

Easier compliance: Many regulatory frameworks require organizations to maintain logs for a certain period of time. Centralized logging can make it easier to meet these requirements by providing a single location to store and manage logs.

Better security: By monitoring logs from a central location, it becomes easier to identify suspicious activity and security threats across the entire infrastructure. This can help organizations to proactively address potential security risks.

Scalability: As organizations grow and add more Windows machines, centralized logging can scale to accommodate the increased volume of logs. This can help ensure that logs are always available and accessible when needed.

Overall, centralized logging for Windows can provide significant benefits for organizations of all sizes, including improved visibility, simplified management, easier compliance, better security, and scalability.