logstash
Process and forward logs to central location
TLDR
Check validity of a Logstash configuration
Run Logstash using configuration
Run Logstash with the most basic inline configuration string
SYNOPSIS
logstash [-f configuration_file] [-e configuration_string] [-t] [-r] [-w workers] [-l log_file] [-V] [-h]
PARAMETERS
-f configuration_file
Specifies the path to the Logstash configuration file. Multiple -f flags can be used to specify multiple configuration files, which are then merged. Directories can also be specified which contain config files.
-e configuration_string
Executes a given Logstash configuration directly as a string. This is useful for quick testing or simple configurations.
-t
Tests the Logstash configuration file(s) for syntax errors without starting the Logstash process.
-r
Automatically reload configuration file(s) on change.
-w workers
Sets the number of worker threads that Logstash uses to process data. Increasing the number of workers can improve throughput but also increase resource consumption.
-l log_file
Specifies the path to the Logstash log file. By default, Logstash logs to the console.
-V
Prints the Logstash version number and exits.
-h
Displays help information and exits.
DESCRIPTION
Logstash is a powerful open-source data processing pipeline tool used to collect, parse, transform, and store data.
It's a core component of the Elastic Stack (ELK), allowing you to ingest data from diverse sources, process it according to defined rules, and then forward it to a variety of outputs, such as Elasticsearch, files, or databases.
Logstash uses plugins to handle input, filter, and output stages. Input plugins define how data is collected (e.g., from files, network sockets, HTTP endpoints). Filter plugins process the data, transforming it based on specific criteria (e.g., parsing timestamps, extracting data from strings, enriching data with geolocation information). Output plugins determine where the processed data is sent.
Configuration is defined in pipeline configuration files that specify the input, filter, and output plugins and their settings. Logstash allows building complex data processing workflows and plays a crucial role in log management, security analytics, and real-time data processing.
CAVEATS
Logstash can be resource-intensive, especially with complex configurations or high data volumes. Careful consideration should be given to resource allocation (CPU, memory) and configuration optimization. Plugin compatibility and updates should also be monitored.
CONFIGURATION FILE STRUCTURE
A Logstash configuration file is typically structured into three main sections: input, filter, and output. Each section defines a series of plugins with their corresponding settings. The order of filters is important, as they are executed sequentially.
PLUGINS
Logstash's extensibility is largely due to its plugin architecture. Numerous plugins are available for various input sources (e.g., file, syslog, TCP, HTTP), filter operations (e.g., grok, mutate, date, geoip), and output destinations (e.g., Elasticsearch, file, Redis, Kafka). Users can also develop custom plugins to meet specific requirements.
HISTORY
Logstash was originally developed by Jordan Sissel. It quickly gained popularity as a versatile log management tool. Later it became part of the Elastic Stack (ELK) along with Elasticsearch and Kibana. It has evolved significantly over time, adding new features, plugins, and performance improvements to support a broader range of data processing use cases. Now maintained by Elastic, the project is still very active.
SEE ALSO
elasticsearch(1), kibana(1)