- Metricbeat Reference: other versions:
- Metricbeat overview
- Quick start: installation and configuration
- Set up and run
- Upgrade Metricbeat
- How Metricbeat works
- Configure
- Modules
- General settings
- Project paths
- Config file loading
- Output
- Kerberos
- SSL
- Index lifecycle management (ILM)
- Elasticsearch index template
- Kibana endpoint
- Kibana dashboards
- Processors
- Define processors
- add_cloud_metadata
- add_cloudfoundry_metadata
- add_docker_metadata
- add_fields
- add_host_metadata
- add_id
- add_kubernetes_metadata
- add_labels
- add_locale
- add_network_direction
- add_nomad_metadata
- add_observer_metadata
- add_process_metadata
- add_tags
- community_id
- convert
- copy_fields
- decode_base64_field
- decode_json_fields
- decode_xml
- decode_xml_wineventlog
- decompress_gzip_field
- detect_mime_type
- dissect
- dns
- drop_event
- drop_fields
- extract_array
- fingerprint
- include_fields
- rate_limit
- registered_domain
- rename
- script
- translate_sid
- truncate_fields
- urldecode
- Autodiscover
- Internal queue
- Logging
- HTTP endpoint
- Regular expression support
- Instrumentation
- metricbeat.reference.yml
- How to guides
- Modules
- ActiveMQ module
- Aerospike module
- Apache module
- App Search module
- AWS module
- AWS billing metricset
- AWS cloudwatch metricset
- AWS dynamodb metricset
- AWS ebs metricset
- AWS ec2 metricset
- AWS elb metricset
- AWS kinesis metricset
- AWS lambda metricset
- AWS natgateway metricset
- AWS rds metricset
- AWS s3_daily_storage metricset
- AWS s3_request metricset
- AWS sns metricset
- AWS sqs metricset
- AWS transitgateway metricset
- AWS usage metricset
- AWS vpn metricset
- AWS Fargate module
- Azure module
- Azure app_insights metricset
- Azure app_state metricset
- Azure billing metricset
- Azure compute_vm metricset
- Azure compute_vm_scaleset metricset
- Azure container_instance metricset
- Azure container_registry metricset
- Azure container_service metricset
- Azure database_account metricset
- Azure monitor metricset
- Azure storage metricset
- Beat module
- Ceph module
- Ceph cluster_disk metricset
- Ceph cluster_health metricset
- Ceph cluster_status metricset
- Ceph mgr_cluster_disk metricset
- Ceph mgr_cluster_health metricset
- Ceph mgr_osd_perf metricset
- Ceph mgr_osd_pool_stats metricset
- Ceph mgr_osd_tree metricset
- Ceph mgr_pool_disk metricset
- Ceph monitor_health metricset
- Ceph osd_df metricset
- Ceph osd_tree metricset
- Ceph pool_disk metricset
- Cloudfoundry module
- CockroachDB module
- Consul module
- Coredns module
- Couchbase module
- CouchDB module
- Docker module
- Dropwizard module
- Elasticsearch module
- Elasticsearch ccr metricset
- Elasticsearch cluster_stats metricset
- Elasticsearch enrich metricset
- Elasticsearch index metricset
- Elasticsearch index_recovery metricset
- Elasticsearch index_summary metricset
- Elasticsearch ml_job metricset
- Elasticsearch node metricset
- Elasticsearch node_stats metricset
- Elasticsearch pending_tasks metricset
- Elasticsearch shard metricset
- Envoyproxy module
- Etcd module
- Google Cloud Platform module
- Golang module
- Graphite module
- HAProxy module
- HTTP module
- IBM MQ module
- IIS module
- Istio module
- Jolokia module
- Kafka module
- Kibana module
- Kubernetes module
- Kubernetes apiserver metricset
- Kubernetes container metricset
- Kubernetes controllermanager metricset
- Kubernetes event metricset
- Kubernetes node metricset
- Kubernetes pod metricset
- Kubernetes proxy metricset
- Kubernetes scheduler metricset
- Kubernetes state_container metricset
- Kubernetes state_cronjob metricset
- Kubernetes state_daemonset metricset
- Kubernetes state_deployment metricset
- Kubernetes state_node metricset
- Kubernetes state_persistentvolumeclaim metricset
- Kubernetes state_pod metricset
- Kubernetes state_replicaset metricset
- Kubernetes state_resourcequota metricset
- Kubernetes state_service metricset
- Kubernetes state_statefulset metricset
- Kubernetes state_storageclass metricset
- Kubernetes system metricset
- Kubernetes volume metricset
- KVM module
- linux module
- Logstash module
- Memcached module
- MongoDB module
- MSSQL module
- Munin module
- MySQL module
- NATS module
- Nginx module
- Openmetrics module
- Oracle module
- PHP_FPM module
- PostgreSQL module
- Prometheus module
- RabbitMQ module
- Redis module
- Redis Enterprise module
- SQL module
- Stan module
- Statsd module
- System module
- System core metricset
- System cpu metricset
- System diskio metricset
- System entropy metricset
- System filesystem metricset
- System fsstat metricset
- System load metricset
- System memory metricset
- System network metricset
- System network_summary metricset
- System process metricset
- System process_summary metricset
- System raid metricset
- System service metricset
- System socket metricset
- System socket_summary metricset
- System uptime metricset
- System users metricset
- Tomcat module
- Traefik module
- uWSGI module
- vSphere module
- Windows module
- ZooKeeper module
- Exported fields
- ActiveMQ fields
- Aerospike fields
- Apache fields
- App Search fields
- AWS fields
- AWS Fargate fields
- Azure fields
- Beat fields
- Beat fields
- Ceph fields
- Cloud provider metadata fields
- Cloudfoundry fields
- CockroachDB fields
- Common fields
- Consul fields
- Coredns fields
- Couchbase fields
- CouchDB fields
- Docker fields
- Docker fields
- Dropwizard fields
- ECS fields
- Elasticsearch fields
- Envoyproxy fields
- Etcd fields
- Google Cloud Platform fields
- Golang fields
- Graphite fields
- HAProxy fields
- Host fields
- HTTP fields
- IBM MQ fields
- IIS fields
- Istio fields
- Jolokia fields
- Jolokia Discovery autodiscover provider fields
- Kafka fields
- Kibana fields
- Kubernetes fields
- Kubernetes fields
- KVM fields
- linux fields
- Logstash fields
- Memcached fields
- MongoDB fields
- MSSQL fields
- Munin fields
- MySQL fields
- NATS fields
- Nginx fields
- Openmetrics fields
- Oracle fields
- PHP_FPM fields
- PostgreSQL fields
- Process fields
- Prometheus fields
- Prometheus typed metrics fields
- RabbitMQ fields
- Redis fields
- Redis Enterprise fields
- SQL fields
- Stan fields
- Statsd fields
- System fields
- Tomcat fields
- Traefik fields
- uWSGI fields
- vSphere fields
- Windows fields
- ZooKeeper fields
- Monitor
- Secure
- Troubleshoot
- Get help
- Debug
- Common problems
- "open /compat/linux/proc: no such file or directory" error on FreeBSD
- Metricbeat collects system metrics for interfaces you didn’t configure
- Metricbeat uses too much bandwidth
- Error loading config file
- Found unexpected or unknown characters
- Logstash connection doesn’t work
- Publishing to Logstash fails with "connection reset by peer" message
- @metadata is missing in Logstash
- Not sure whether to use Logstash or Beats
- SSL client fails to connect to Logstash
- Monitoring UI shows fewer Beats than expected
- Dashboard could not locate the index-pattern
- Contribute to Beats
Configure modules
editConfigure modules
editYou can configure modules in the modules.d
directory (recommended), or in the
Metricbeat configuration file.
Before running Metricbeat with modules enabled, make sure you also set up the environment to use Kibana dashboards. See Quick start: installation and configuration for more information.
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.
Configure modules in the modules.d
directory
editThe modules.d
directory contains default configurations for all the modules
available in Metricbeat. To enable or disable specific module configurations
under modules.d
, run the
modules enable
or modules disable
command. For example:
metricbeat modules enable apache mysql
metricbeat modules enable apache mysql
./metricbeat modules enable apache mysql
metricbeat modules enable apache mysql
./metricbeat modules enable apache mysql
PS > .\metricbeat.exe 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
metricbeat modules list
./metricbeat modules list
metricbeat modules list
./metricbeat modules list
PS > .\metricbeat.exe modules list
To change the default module configurations, modify 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.
Configure modules in the metricbeat.yml
file
editWhen possible, you should use the config files in the modules.d
directory.
However, configuring 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, 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 variants
editEvery module comes with a default configuration file. Some modules also come with one or more variant configuration files containing common alternative configurations for that module.
When you see the list of enabled and disabled modules, those modules with configuration
variants will be shown as <module_name>-<variant_name>
. You can enable or disable
specific configuration variants of a module by specifying metricbeat modules enable
<module_name>-<variant_name>
and metricbeat modules disable <module_name>-<variant_name>
respectively.
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 Processors for information about specifying processors in your config.
index
editIf present, this formatted string overrides the index for events from this
module (for elasticsearch outputs), or sets the raw_index
field of the event’s
metadata (for other outputs). This string can only refer to the agent name and
version and the event timestamp; for access to dynamic fields, use
output.elasticsearch.index
or a processor.
Example value: "%{[agent.name]}-myindex-%{+yyyy.MM.dd}"
might
expand to "metricbeat-myindex-2019.12.13"
.
keep_null
editIf this option is set to true, fields with null
values will be published in
the output document. By default, keep_null
is set to false
.
service.name
editA name given by the user to the service the data is collected from. It can be
used for example to identify information collected from nodes of different
clusters with the same service.type
.
Standard HTTP config options
editModules and metricsets that define the host as an HTTP URL can use the standard
schemes for HTTP (http://
and https://
) and the following schemes to connect
to local pipes:
-
http+unix://
to connect to UNIX sockets. -
http+npipe://
to connect to Windows named pipes.
The 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.
connect_timeout
editTotal time limit for an HTTP connection to be completed (Default: 2 seconds).
timeout
editTotal time limit for HTTP requests made by the module (Default: 10 seconds).
ssl
editConfiguration options for SSL parameters like the certificate authority to use for HTTPS-based connections.
See SSL 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.
query
editAn optional value to pass common query params in YAML. Instead of setting the query params
within hosts values using the syntax ?key=value&key2&value2
, you can set it here like this:
query: key: value key2: value2 list: - 1.1 - 2.95 - -15
On this page
- Configure modules in the
modules.d
directory - Configure modules in the
metricbeat.yml
file - Configuration variants
- Configuration combinations
- Standard config options
module
metricsets
enabled
period
hosts
fields
tags
processors
index
keep_null
service.name
- Standard HTTP config options
username
password
connect_timeout
timeout
ssl
headers
bearer_token_file
basepath
query