How to Install Logstash on Windows 10
Introduction
Logstash is an open-source tool that helps in collecting, processing, and sending logs and other event data. It is part of the Elastic Stack, which also includes Elasticsearch and Kibana. In this tutorial, we will learn how to install Logstash on Windows 10.
Prerequisites
Before starting, you need to make sure that you have the following items installed on your system:
- Java Runtime Environment (JRE) version 8 or later
- A text editor to edit configuration files
Step 1: Download Logstash
First, head to the official Logstash website and download the Windows version of Logstash.
Step 2: Extract Logstash
After the download is complete, extract the contents of the downloaded archive to a folder of your choice.
Step 3: Configure Logstash
Open a text editor and create a new file named logstash.conf. This file will contain the configuration of Logstash.
Add the following content to logstash.conf, which defines a simple Logstash pipeline that receives logs on port 5000 and sends them to Elasticsearch.
input {
tcp {
port => 5000
}
}
output {
elasticsearch {
hosts => ["http://localhost:9200"]
index => "logstash-%{+YYYY.MM.dd}"
}
}
Remember to replace localhost with the hostname or IP address of your Elasticsearch instance and customize the index name to your preferences.
Save the logstash.conf file in the same folder as the extracted Logstash files.
Step 4: Start Logstash
Open the Windows command prompt and navigate to the Logstash folder using the cd command.
Run the following command to start Logstash and load the configuration from the logstash.conf file:
.\bin\logstash -f logstash.conf
You should see Logstash starting up and printing logs in the command prompt. If everything goes well, Logstash should be listening on port 5000 and be ready to receive logs.
Conclusion
That's it! You have successfully installed Logstash on Windows 10 and configured it to receive and send logs to Elasticsearch. You can now start sending logs to Logstash and visualize and analyze them using Kibana.