- Metricbeat Reference: other versions:
- Overview
- Get started
- Set up and run
- Upgrade Metricbeat
- How Metricbeat works
- Configure
- Modules
- General settings
- Project paths
- Config file loading
- Output
- 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
- Autodiscover
- Internal queue
- Logging
- HTTP endpoint
- Regular expression support
- 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
- 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_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
- 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
- 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
- @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 Elasticsearch index template loading
editConfigure Elasticsearch index template loading
editThe setup.template
section of the metricbeat.yml
config file specifies
the index template to use for setting
mappings in Elasticsearch. If template loading is enabled (the default),
Metricbeat loads the index template automatically after successfully
connecting to Elasticsearch.
A connection to Elasticsearch is required to load the index template. If the configured output is not Elasticsearch (or Elastic Cloud), you must load the template manually.
You can adjust the following settings to load your own template or overwrite an existing one.
-
setup.template.enabled
- Set to false to disable template loading. If set this to false, you must load the template manually.
-
setup.template.name
-
The name of the template. The default is
metricbeat
. The Metricbeat version is always appended to the given name, so the final name ismetricbeat-%{[agent.version]}
.
-
setup.template.pattern
-
The template pattern to apply to the default index settings. The default pattern is
metricbeat-*
. The Metricbeat version is always included in the pattern, so the final pattern ismetricbeat-%{[agent.version]}-*
. The wildcard character-*
is used to match all daily indices.Example:
setup.template.name: "metricbeat" setup.template.pattern: "metricbeat-*"
-
setup.template.fields
-
The path to the YAML file describing the fields. The default is
fields.yml
. If a relative path is set, it is considered relative to the config path. See the Directory layout section for details. -
setup.template.overwrite
- A boolean that specifies whether to overwrite the existing template. The default is false.
-
setup.template.settings
-
A dictionary of settings to place into the
settings.index
dictionary of the Elasticsearch template. For more details about the available Elasticsearch mapping options, please see the Elasticsearch mapping reference.Example:
setup.template.name: "metricbeat" setup.template.fields: "fields.yml" setup.template.overwrite: false setup.template.settings: index.number_of_shards: 1 index.number_of_replicas: 1
-
setup.template.settings._source
-
A dictionary of settings for the
_source
field. For the available settings, please see the Elasticsearch reference.Example:
setup.template.name: "metricbeat" setup.template.fields: "fields.yml" setup.template.overwrite: false setup.template.settings: _source.enabled: false
-
setup.template.append_fields
-
A list of fields to be added to the template and Kibana index pattern. This setting adds new fields. It does not overwrite or change existing fields.
This setting is useful when your data contains fields that Metricbeat doesn’t know about in advance. For example, you might want to append fields to the template when you’re using a metricset, such as the HTTP json metricset, and the full data structure is not known in advance.
If
append_fields
is specified along withoverwrite: true
, Metricbeat overwrites the existing template and applies the new template when creating new indices. Existing indices are not affected. If you’re running multiple instances of Metricbeat with differentappend_fields
settings, the last one writing the template takes precedence.Any changes to this setting also affect the Kibana index pattern.
Example config:
setup.template.overwrite: true setup.template.append_fields: - name: test.name type: keyword - name: test.hostname type: long
-
setup.template.json.enabled
-
Set to
true
to load a JSON-based template file. Specify the path to your Elasticsearch index template file and set the name of the template.setup.template.json.enabled: true setup.template.json.path: "template.json" setup.template.json.name: "template-name
If the JSON template is used, the fields.yml
is skipped for the template
generation.