- Metricbeat Reference: other versions:
- Overview
- Getting started with Metricbeat
- Setting up and running Metricbeat
- Upgrading Metricbeat
- How Metricbeat works
- Configuring Metricbeat
- Specify which modules to run
- Specify general settings
- Load external configuration files
- Configure the internal queue
- Configure the output
- Specify SSL settings
- Filter and enhance the exported data
- Parse data by using ingest node
- Set up project paths
- Set up the Kibana endpoint
- Load the Kibana dashboards
- Load the Elasticsearch index template
- Configure logging
- Use environment variables in the configuration
- Autodiscover
- YAML tips and gotchas
- Regular expression support
- HTTP Endpoint
- metricbeat.reference.yml
- Modules
- Aerospike module
- Apache module
- Ceph module
- Couchbase module
- Docker module
- Dropwizard module
- Elasticsearch module
- Elasticsearch cluster_stats metricset
- Elasticsearch index metricset
- Elasticsearch index_recovery metricset
- Elasticsearch index_summary metricset
- Elasticsearch ml_job metricset
- elasticsearch ml_job MetricSet
- Elasticsearch node metricset
- Elasticsearch node_stats metricset
- Elasticsearch pending_tasks metricset
- elasticsearch pending_tasks MetricSet
- Elasticsearch shard metricset
- envoyproxy module
- Etcd module
- Golang module
- Graphite module
- HAProxy module
- HTTP module
- Jolokia module
- Kafka module
- Kibana module
- Kubernetes module
- Kubernetes apiserver metricset
- Kubernetes container metricset
- Kubernetes event metricset
- Kubernetes node metricset
- Kubernetes pod metricset
- Kubernetes state_container metricset
- Kubernetes state_deployment metricset
- Kubernetes state_node metricset
- Kubernetes state_pod metricset
- Kubernetes state_replicaset metricset
- Kubernetes state_statefulset metricset
- Kubernetes system metricset
- Kubernetes volume metricset
- kvm module
- Logstash module
- Memcached module
- MongoDB module
- Munin module
- MySQL module
- Nginx module
- PHP_FPM module
- PostgreSQL module
- Prometheus module
- RabbitMQ module
- Redis module
- System module
- System core metricset
- System cpu metricset
- System diskio metricset
- System filesystem metricset
- System fsstat metricset
- System load metricset
- System memory metricset
- System network metricset
- System process metricset
- System process_summary metricset
- System raid metricset
- System socket metricset
- System uptime metricset
- traefik module
- uwsgi module
- vSphere module
- Windows module
- ZooKeeper module
- Exported fields
- Aerospike fields
- Apache fields
- Beat fields
- Ceph fields
- Cloud provider metadata fields
- Common fields
- Couchbase fields
- Docker fields
- Docker fields
- Dropwizard fields
- Elasticsearch fields
- envoyproxy fields
- Etcd fields
- Golang fields
- Graphite fields
- HAProxy fields
- Host fields
- HTTP fields
- Jolokia fields
- Kafka fields
- Kibana fields
- Kubernetes fields
- Kubernetes fields
- kvm fields
- Logstash fields
- Memcached fields
- MongoDB fields
- Munin fields
- MySQL fields
- Nginx fields
- PHP_FPM fields
- PostgreSQL fields
- Prometheus fields
- RabbitMQ fields
- Redis fields
- System fields
- traefik fields
- uwsgi fields
- vSphere fields
- Windows fields
- ZooKeeper fields
- Monitoring Metricbeat
- Securing Metricbeat
- Troubleshooting
- Contributing to Beats
Specify which modules to run
editSpecify which modules to run
editMetricbeat provides a couple different ways to enable modules and metricsets:
On systems with POSIX file permissions, all Beats configuration files are subject to ownership and file permission checks. For more information, see Config File Ownership and Permissions in the Beats Platform Reference.
Enable module configs in the modules.d
directory
editThe modules.d
directory contains default configurations for all the modules
available in Metricbeat. You can enable or disable specific module
configurations under modules.d
by running the modules
enable
or modules disable
commands.
For example, to enable the apache
and mysql
configs in the modules.d
directory, you use:
./metricbeat modules enable apache mysql
Then when you run Metricbeat, it loads the corresponding module configurations
specified in the modules.d
directory (for example, modules.d/apache.yml
and
modules.d/mysql.yml
).
To see a list of enabled and disabled modules, run:
./metricbeat modules list
You can change the default module configurations by modifying the .yml
files
in the modules.d
directory.
The following example shows a basic configuration for the Apache module:
- module: apache metricsets: ["status"] hosts: ["http://127.0.0.1/"] period: 10s fields: dc: west tags: ["tag"] processors: ....
See Configuration combinations for additional configuration examples.
Enable module configs in the metricbeat.yml
file
editWhen possible, you should use the config files in the modules.d
directory.
However, enabling modules directly in the config file is a practical approach if
you have upgraded from a previous version of Metricbeat and don’t want to
move your module configs to the modules.d
directory. You can continue to
configure modules in the metricbeat.yml
file, but you won’t be able to use
the modules
command to enable and disable configurations because the command
requires the modules.d
layout.
To enable specific modules and metricsets in the metricbeat.yml
config
file, you can add entries to the metricbeat.modules
list. Each entry in the
list begins with a dash (-) and is followed by settings for that module.
The following example shows a configuration where the apache and mysql modules are enabled:
metricbeat.modules: #---------------------------- Apache Status Module --------------------------- - module: apache metricsets: ["status"] period: 1s hosts: ["http://127.0.0.1/"] #---------------------------- MySQL Status Module ---------------------------- - module: mysql metricsets: ["status"] period: 2s hosts: ["root@tcp(127.0.0.1:3306)/"]
In the following example, the Redis host is crawled for stats
information
every second because this is critical data, but the full list of Apache
metricsets is only fetched every 30 seconds because the metrics are less
critical.
metricbeat.modules: - module: redis metricsets: ["info"] hosts: ["host1"] period: 1s - module: apache metricsets: ["info"] hosts: ["host1"] period: 30s
Configuration combinations
editYou can specify a module configuration that uses different combinations of metricsets, periods, and hosts.
For a module with multiple metricsets defined, it’s possible to define the
module twice and specify a different period to use for each metricset. For the
following example, the set1
metricset will be fetched every 10 seconds, while
the set2
metricset will be fetched every 2 minutes:
- module: example metricsets: ["set1"] hosts: ["host1"] period: 10s - module: example metricsets: ["set2"] hosts: ["host1"] period: 2m
Standard config options
editYou can specify the following options for any Metricbeat module. Some modules require additional configuration settings. See the Modules section for more information.
module
editThe name of the module to run. For documentation about each module, see the Modules section.
metricsets
editA list of metricsets to execute. Make sure that you only list metricsets that are available in the module. It is not possible to reference metricsets from other modules. For a list of available metricsets, see Modules.
enabled
editA Boolean value that specifies whether the module is enabled. If you use the
default config file, metricbeat.yml
, the System module is enabled (set to
enabled: true
) by default. If the enabled
option is missing from the
configuration block, the module is enabled by default.
period
editHow often the metricsets are executed. If a system is not reachable, Metricbeat returns an error for each period. This setting is required.
hosts
editA list of hosts to fetch information from. For some metricsets, such as the System module, this setting is optional.
fields
editA dictionary of fields that will be sent with the metricset event. This setting is optional.
tags
editA list of tags that will be sent with the metricset event. This setting is optional.
processors
editA list of processors to apply to the data generated by the metricset.
See Filter and enhance the exported data for information about specifying processors in your config.
Standard HTTP config options
editThe following options are available for modules and metricsets that define the host as an HTTP URL:
username
editThe username to use for basic authentication.
password
editThe password to use for basic authentication.
ssl
editConfiguration options for SSL parameters like the certificate authority to use for HTTPS-based connections.
See Specify SSL settings for more information.
headers
editA list of headers to use with the HTTP request. For example:
headers: Cookie: abcdef=123456 My-Custom-Header: my-custom-value
bearer_token_file
editIf defined, Metricbeat will read the contents of the file once at initialization and then use the value in an HTTP Authorization header.
basepath
editAn optional base path to be used in HTTP URIs. If defined, Metricbeat will insert this value as the first segment in the HTTP URI path.
On this page