logstash/docs/static/getting-started-with-logstash.asciidoc
2016-03-20 02:24:06 +00:00

59 lines
2.2 KiB
Text

[[getting-started-with-logstash]]
== Getting Started with Logstash
This section guides you through the process of installing Logstash and verifying that everything is running properly.
Later sections deal with increasingly complex configurations to address selected use cases.
[float]
[[installing-logstash]]
=== Install Logstash
NOTE: Logstash requires Java 7 or later. Use the
http://www.oracle.com/technetwork/java/javase/downloads/index.html[official Oracle distribution] or an open-source
distribution such as http://openjdk.java.net/[OpenJDK].
To check your Java version, run the following command:
[source,shell]
java -version
On systems with Java installed, this command produces output similar to the following:
[source,shell]
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
[float]
[[installing-binary]]
==== Installing from a downloaded binary
Download the https://www.elastic.co/downloads/logstash[Logstash installation file] that matches your host environment.
Unpack the file. On supported Linux operating systems, you can <<package-repositories,use a package manager>> to
install Logstash.
[[first-event]]
=== Stashing Your First Event: Basic Logstash Example
To test your Logstash installation, run the most basic Logstash pipeline:
[source,shell]
cd logstash-{logstash_version}
bin/logstash -e 'input { stdin { } } output { stdout {} }'
The `-e` flag enables you to specify a configuration directly from the command line. Specifying configurations at the
command line lets you quickly test configurations without having to edit a file between iterations.
This pipeline takes input from the standard input, `stdin`, and moves that input to the standard output, `stdout`, in a
structured format.
Once "Logstash startup completed" is displayed, type hello world at the command prompt to see Logstash respond:
[source,shell]
hello world
2013-11-21T01:22:14.405+0000 0.0.0.0 hello world
Logstash adds timestamp and IP address information to the message. Exit Logstash by issuing a *CTRL-D* command in the
shell where Logstash is running.
The <<advanced-pipeline,Advanced Tutorial>> expands the capabilities of your Logstash instance to cover broader
use cases.