- 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
Load the Elasticsearch index template
editLoad the Elasticsearch index template
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 output is Logstash, 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-%{[beat.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-%{[beat.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
[preview] This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. -
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.