Creating a Logstash Pipeline
Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud. Availability This functionality is generally available and ready for production usage. Serverless interfaces and procedures might differ from classic Elastic Stack deployments. The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability This functionality is generally available and ready for production usage. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.
Serverless
Generally available
Stack
Generally available
You can create a pipeline to process data by using several plugins together, like inputs, outputs, filters, and codecs. To build a Logstash pipeline, create a configuration file to specify which plugins you want to use and the settings for each plugin.
The minimum components of a pipeline are one input and one output. Most pipelines include at least one filter plugin because that’s where the processing part of the extract, transform, load (ETL) happens. You can reference event fields in a pipeline and use conditionals to process events when they meet certain criteria.
Let’s step through creating a simple pipeline config on your local machine and then using it to run Logstash. Create a file named "logstash-simple.conf" and save it in the same directory as Logstash. For example:
input { stdin { } }
output {
elasticsearch { cloud_id => "<cloud id>" api_key => "<api key>" }
stdout { codec => rubydebug }
}
Then, run Logstash and specify the configuration file with the -f flag.
bin/logstash -f logstash-simple.conf
Logstash now reads the specified configuration file and outputs to both Elasticsearch and stdout. Before you move on to more complex examples, take a look at what’s in a pipeline config file.