- 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_observer_metadata
- add_process_metadata
- add_tags
- community_id
- convert
- copy_fields
- decode_base64_field
- decode_json_fields
- decompress_gzip_field
- dissect
- dns
- drop_event
- drop_fields
- extract_array
- fingerprint
- include_fields
- 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
- Beats central management
- 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 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
- 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
- Golang module
- Google Cloud Platform 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
- 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
- Golang fields
- Google Cloud Platform 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
Use Metricbeat to send monitoring data
editUse Metricbeat to send monitoring data
editIn 7.3 and later, you can use Metricbeat to collect data about Metricbeat and ship it to the monitoring cluster. The benefit of using Metricbeat instead of internal collection is that the monitoring agent remains active even if the Metricbeat instance dies.
Because you’ll be using Metricbeat to monitor Metricbeat, you’ll need to run two instances of Metricbeat: a main instance that collects metrics from the system and services running on the server, and a second instance that collects metrics from Metricbeat only. Using a separate instance as a monitoring agent allows you to send monitoring data to a dedicated monitoring cluster. If the main agent goes down, the monitoring agent remains active.
If you’re running Metricbeat as a service, this approach requires extra work because you need to run two instances of the same installed service concurrently. If you don’t want to run two instances concurrently, use internal collection instead of using Metricbeat.
To collect and ship monitoring data:
Configure the shipper you want to monitor
edit-
Enable the HTTP endpoint to allow external collection of monitoring data:
Add the following setting in the Metricbeat configuration file (
metricbeat.yml
):http.enabled: true
By default, metrics are exposed on port 5066. If you need to monitor multiple Beats shippers running on the same server, set
http.port
to expose metrics for each shipper on a different port number:http.port: 5067
-
Disable the default collection of Metricbeat monitoring metrics.
Add the following setting in the Metricbeat configuration file (
metricbeat.yml
):monitoring.enabled: false
For more information, see Monitoring configuration options.
-
Configure host (optional).
If you intend to get metrics using Metricbeat installed on another server, you need to bind the Metricbeat to host’s IP:
http.host: xxx.xxx.xxx.xxx
-
Configure cluster uuid (optional).
To see the Beats monitoring section in Kibana if you have a cluster, you need to associate the Metricbeat with cluster UUID:
monitoring.cluster_uuid: "cluster-uuid"
- Start Metricbeat.
Install and configure Metricbeat to collect monitoring data
edit-
The next step depends on how you want to run Metricbeat:
- If you’re running as a service and want to run a separate monitoring instance, take the the steps required for your environment to run two instances of Metricbeat as a service. The steps for doing this vary by platform and are beyond the scope of this documentation.
-
If you’re running the binary directly in the foreground and want to run a
separate monitoring instance, install Metricbeat to a different path. If
necessary, set
path.config
,path.data
, andpath.log
to point to the correct directories. See Directory layout for the default locations.
-
Enable the
beat-xpack
module in Metricbeat.For example, to enable the default configuration in the
modules.d
directory, run the following command, using the correct command syntax for your OS:metricbeat modules enable beat-xpack
For more information, see Configure modules and beat module.
-
Configure the
beat-xpack
module in Metricbeat.The
modules.d/beat-xpack.yml
file contains the following settings:- module: beat metricsets: - stats - state period: 10s hosts: ["http://localhost:5066"] #username: "user" #password: "secret" xpack.enabled: true
Set the
hosts
,username
, andpassword
settings as required by your environment. For other module settings, it’s recommended that you accept the defaults.By default, the module collects Metricbeat monitoring data from
localhost:5066
. If you exposed the metrics on a different host or port when you enabled the HTTP endpoint, update thehosts
setting.To monitor multiple Beats agents, specify a list of hosts, for example:
hosts: ["http://localhost:5066","http://localhost:5067","http://localhost:5068"]
If you configured Metricbeat to use encrypted communications, you must access it via HTTPS. For example, use a
hosts
setting likehttps://localhost:5066
.If the Elastic security features are enabled, you must also provide a user ID and password so that Metricbeat can collect metrics successfully:
-
Create a user on the Elasticsearch cluster that has the
remote_monitoring_collector
built-in role. Alternatively, if it’s available in your environment, use theremote_monitoring_user
built-in user. -
Add the
username
andpassword
settings to the beat module configuration file.
-
Create a user on the Elasticsearch cluster that has the
-
Optional: Disable the system module in the Metricbeat.
By default, the system module is enabled. The information it collects, however, is not shown on the Stack Monitoring page in Kibana. Unless you want to use that information for other purposes, run the following command:
metricbeat modules disable system
-
Identify where to send the monitoring data.
In production environments, we strongly recommend using a separate cluster (referred to as the monitoring cluster) to store the data. Using a separate monitoring cluster prevents production cluster outages from impacting your ability to access your monitoring data. It also prevents monitoring activities from impacting the performance of your production cluster.
For example, specify the Elasticsearch output information in the Metricbeat configuration file (
metricbeat.yml
):output.elasticsearch: # Array of hosts to connect to. hosts: ["http://es-mon-1:9200", "http://es-mon2:9200"] # Optional protocol and basic auth credentials. #protocol: "https" #api_key: "id:api_key" #username: "elastic" #password: "changeme"
In this example, the data is stored on a monitoring cluster with nodes
es-mon-1
andes-mon-2
.Specify one of
api_key
orusername
/password
.If you configured the monitoring cluster to use encrypted communications, you must access it via HTTPS. For example, use a
hosts
setting likehttps://es-mon-1:9200
.The Elasticsearch monitoring features use ingest pipelines, therefore the cluster that stores the monitoring data must have at least one ingest node.
If the Elasticsearch security features are enabled on the monitoring cluster, you must provide a valid user ID and password so that Metricbeat can send metrics successfully:
-
Create a user on the monitoring cluster that has the
remote_monitoring_agent
built-in role. Alternatively, if it’s available in your environment, use theremote_monitoring_user
built-in user.If you’re using index lifecycle management, the remote monitoring user requires additional privileges to create and read indices. For more information, see Grant users access to secured resources.
-
Add the
username
andpassword
settings to the Elasticsearch output information in the Metricbeat configuration file.
For more information about these configuration options, see Configure the Elasticsearch output.
-
- Start Metricbeat to begin collecting monitoring data.
- View the monitoring data in Kibana.
On this page