How to configure Winlogbeat to collect Application, Security, System and Sysmon logs and…
- User
How to configure Winlogbeat to collect Application, Security, System and Sysmon logs and send them to two logstash servers?
- Assistant
- Assistant
How to configure Winlogbeat to collect Application, Security, System and Sysmon logs and send them to two logstash servers?
Configuring Winlogbeat to collect logs from the Application, Security, System, and Sysmon channels and sending them to two Logstash servers can be done by modifying the winlogbeat.yml configuration file. Below are the steps needed to set up this configuration.
Open the winlogbeat.yml configuration file located in the Winlogbeat installation directory.
Define Event Logs to Collect: Add the event logs you want Winlogbeat to collect.
Configure Output to Logstash: Set up Winlogbeat to send logs to the two Logstash servers.
Here's an example configuration for winlogbeat.yml:
winlogbeat.event_logs:
- name: Application
ignore_older: 72h
- name: Security
ignore_older: 72h
- name: System
ignore_older: 72h
- name: Microsoft-Windows-Sysmon/Operational
ignore_older: 72h
output.logstash:
hosts: ["logstash_server_1:5044", "logstash_server_2:5044"]
loadbalance: true
worker: 2
# Optional: additional settings
processors:
- add_host_metadata: ~
- add_cloud_metadata: ~
- add_fields:
target: ''
fields:
env: production
# Logging Configuration
logging.level: info
logging.to_files: true
logging.files:
path: /var/log/winlogbeat
name: winlogbeat
keepfiles: 7
permissions: 0644
rotateeverybytes: 10485760 # = 10MB
In this example:
winlogbeat.event_logs section specifies the event logs to be collected: Application, Security, System, and Sysmon logs.output.logstash section specifies two Logstash servers (e.g., logstash_server_1 and logstash_server_2) configured to accept incoming data on port 5044. Load balancing is enabled with loadbalance: true, and the worker setting defines the number of workers to use.Start Winlogbeat: Use PowerShell to start the service.
Start-Service winlogbeat
Check Logs: Ensure that Winlogbeat is running correctly and sending logs to the specified Logstash servers. You can check the Winlogbeat logs typically found in the directory specified in the logging.files.path setting or in the default logs directory within the Winlogbeat installation folder.
Verify Log Receipt: On your Logstash servers, verify that the logs are being received and processed correctly. This typically involves checking the Logstash logs and ensuring that the data has been ingested by the Elasticsearch cluster or any other configured output.
5044) are open and that both Logstash servers are properly configured to receive and process logs from Winlogbeat.logstash_server_1 and logstash_server_2 should be replaced with the actual hostnames or IP addresses of your Logstash servers.This should set up Winlogbeat to collect the specified logs and send them to both Logstash servers in a load-balanced manner.
It seems like you might be looking for further detailed steps, or perhaps there's an additional question. Let me know how I can assist you further!
However, if you need fully detailed instruction step by step, here's a walk-through to ensure everything works smoothly:
Download Winlogbeat:
Extract the Zip File:
Install Winlogbeat:
.\install-service-winlogbeat.ps1
Edit the Configuration File:
winlogbeat.yml file located in the Winlogbeat directory using a text editor like Notepad++ or Visual Studio Code.Define Event Logs to Collect:
winlogbeat.event_logs:
- name: Application
ignore_older: 72h
- name: Security
ignore_older: 72h
- name: System
ignore_older: 72h
- name: Microsoft-Windows-Sysmon/Operational
ignore_older: 72h
Configure Output to Logstash:
output.logstash:
hosts: ["logstash_server_1:5044", "logstash_server_2:5044"]
loadbalance: true
worker: 2
Optional: Add Processors:
processors:
- add_host_metadata: ~
- add_cloud_metadata: ~
- add_fields:
target: ''
fields:
env: production
Logging Configuration:
logging.level: info
logging.to_files: true
logging.files:
path: C:/ProgramData/winlogbeat/logs
name: winlogbeat
keepfiles: 7
permissions: 0644
rotateeverybytes: 10485760 # = 10MB
Start Winlogbeat Service:
Start-Service winlogbeat
Check Winlogbeat Logs:
C:/ProgramData/winlogbeat/logs) and open the latest log file to ensure there are no errors.Verify Logs on Logstash:
logstash-plain.log file on your Logstash servers.5044).logstash.conf file, something similar to:
input {
beats {
port => 5044
}
}
output {
elasticsearch {
hosts => ["http://localhost:9200"]
index => "your_index_name"
}
# Additional outputs can be configured here
}
By following these detailed steps, you should have a working configuration of Winlogbeat sending logs from Application, Security, System, and Sysmon channels to two Logstash servers in a load-balanced manner. Let me know if there's more you need assistance with!