Logstash – Receiving, Processing, and Forwarding Logs to ELK.
Logstash
Logstash is a powerful tool designed for collecting, processing, and forwarding logs or event data. It acts as a data pipeline between different sources (e.g., system logs, applications, Beats) and destinations (e.g., Elasticsearch, databases, cloud storage).
In this setup, we are simulating a real-world logging pipeline where multiple Windows machines, each running Winlogbeat, collect logs and forward them to a central Logstash server. In enterprise environments, organizations often have dozens or even hundreds of endpoints generating logs. Instead of sending logs directly to Elasticsearch, Logstash acts as an intermediary, allowing for log enrichment, filtering, and transformation before forwarding the processed data to ELK for storage and analysis.
For the sake of resource limitations, we will be using only one Windows machine in this lab. However, in a real-world deployment, Winlogbeat would be installed on multiple Windows endpoints, and rather than installing it manually on each machine, organizations typically use Active Directory Group Policy (GPO) to deploy and configure it across all endpoints automatically. This ensures efficient management, consistency, and scalability of log collection in large infrastructures.
Environment Setup
Windows machine: Running Winlogbeat to collect Windows logs
Ubuntu machine: Logstash will be running on it, processing logs from its input (winlogbeat), then forwarding them to its output (Elasticsearch).
Another Ubuntu machine: Elasticsearch and kibana are running on it
Logstash Installation and configuration
We can install logstash by those lines
Next, we will create a new configuration file to define the Logstash pipeline

Logstash pipeline explanation:
Input: Listens for logs from Beats on port 5044.
Filter: Adds a custom field to mark the logs as coming from Winlogbeat.
Output: Sends logs to Elasticsearch, using an index format based on the date.
Check if the configuration is correct

Now we will start and enable Logstash service

Next, we will run Logstash using the configuration file we made

Now Logstash will be listening on port 5044 for incoming data, and it will apply the filter we made to it and then forward it to Elasticsearch as we configured.
Configuring Winlogbeat on Windows
Open the Winlogbeat configuration file and update the output.logstash section with your logstash machine's IP

To confirm these configurations, we will run:

Now, start winlogbeat service and confirm its status

Next, run winlogbeat using the winlogbeat.yml we updated previously

Verifying Logs in Kibana
From index management

From discover

you can see the field we added in the filter of the logstash pipeline, or you can search with the field name at the top left bar
Last updated