This section guides you through the process of installing Logstash and verifying that everything is running properly. After learning how to stash your first event, you go on to create a more advanced pipeline that takes Apache web logs as input, parses the logs, and writes the parsed data to an Elasticsearch cluster. Then you learn how to stitch together multiple input and output plugins to unify data from a variety of disparate sources.
This section includes the following topics:
Java (JVM) versionedit
Logstash requires one of these versions:
- Java 8
- Java 11
- Java 14
Logstash offers architecture-specific downloads that include AdoptOpenJDK 11, the latest long term support (LTS) release of JDK.
Use the JAVA_HOME environment variable if you want to use a JDK other than the version that is bundled. If you have the JAVA_HOME environment variable set to use a custom JDK, Logstash will continue to use the JDK version you have specified, even after you upgrade.
Check your Java versionedit
Run the following command:
On systems with Java installed, this command produces output similar to the following:
java version "11.0.1" 2018-10-16 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.1+13-LTS, mixed mode)
Logstash uses the Java version set in
variable must be set for Logstash to operate correctly.
On some Linux systems, you may need to have the
exported before installing Logstash, particularly if you installed Java from
Logstash uses Java during installation to automatically detect your environment and
install the correct startup method (SysV init scripts, Upstart, or systemd). If
Logstash is unable to find the
JAVA_HOME environment variable during package
installation, you may get an error message, and Logstash will not start properly.