This topic describes how to install Logstash.
Background information
Logstash is an open source software application for data collection. You can use Logstash
to collect logs and then use the logstash-output-logservice plug-in to upload the
logs to Log Service. To download the logstash-output-logservice plug-in, visit GitHub.
Procedure
- Install the JDK package.
- Download the JDK package.
Go to the
Java official website, download the JDK package, and then double-click the package to install the JDK package.
- Set the environment variables.
Choose . In the window that appears, set the environment variables.
- PATH: C:\Program Files\Java\jdk1.8.0_73\bin
- CLASSPATH: C:\Program Files\Java\jdk1.8.0_73\lib;C:\Program Files\Java\jdk1.8.0_73\lib\tools.jar
- JAVA_HOME: C:\Program Files\Java\jdk1.8.0_73
Replace jdk1.8.0_73 with your actual JDK version.
- Verify that the JDK package is installed.
Run the
java -version command. If a result that is similar to the following example is returned, the JDK
package is installed.
PS C:\Users\Administrator> java -version
java version "1.8.0_73"
Java(TM) SE Runtime Environment (build 1.8.0_73-b02)
Java HotSpot(TM) 64-Bit Server VM (build 25.73-b02, mixed mode)
PS C:\Users\Administrator> javac -version
javac 1.8.0_73
- Install Logstash.
- Download the Logstash installation package.
Note We recommend that you download Logstash 5.0 or later.
- Decompress the downloaded package to the specified directory.
- Install Logstash plug-in.
- Select the installation mode based on the network environment of the server.
- Verify that the Logstash plug-in is installed.
Run the following command. If the logstash-output-logservice plug-in is displayed
in the returned plug-in list, the plug-in is installed.
PS C:\logstash-6.4.3> .\bin\logstash-plugin list