WARNING: Version 5.1 of Metricbeat has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. For the latest information, see the current release documentation.
Configuring Metricbeat to Use Logstash
editConfiguring Metricbeat to Use Logstash
editIf you want to use Logstash to perform additional processing on the data collected by Metricbeat, you need to configure Metricbeat to use Logstash.
To do this, you edit the Metricbeat configuration file to disable the Elasticsearch output by commenting it out and enable the Logstash output by uncommenting the logstash section:
#----------------------------- Logstash output -------------------------------- output.logstash: hosts: ["127.0.0.1:5044"]
The hosts
option specifies the Logstash server and the port (5044
) where Logstash is configured to listen for incoming
Beats connections.
For this configuration, you must load the index template into Elasticsearch manually because the options for auto loading the template are only available for the Elasticsearch output.
To test your configuration file, change to the directory where the Metricbeat
binary is installed, and run Metricbeat in the foreground with the following
options specified: ./metricbeat -configtest -e
. Make sure your config files are
in the path expected by Metricbeat (see Directory Layout). If you
installed from DEB or RPM packages, run ./metricbeat.sh -configtest -e
.
To use this configuration, you must also set up Logstash to receive events from Beats.