Load the Elasticsearch index templateedit

The setup.template section of the winlogbeat.yml config file specifies the index template to use for setting mappings in Elasticsearch. If template loading is enabled (the default), Winlogbeat 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.

Set to false to disable template loading. If set this to false, you must load the template manually.
The name of the template. The default is winlogbeat. The Winlogbeat version is always appended to the given name, so the final name is winlogbeat-%{[beat.version]}.

The template pattern to apply to the default index settings. The default pattern is winlogbeat-*. The Winlogbeat version is always included in the pattern, so the final pattern is winlogbeat-%{[beat.version]}-*. The wildcard character -* is used to match all daily indices.


setup.template.name: "winlogbeat"
setup.template.pattern: "winlogbeat-*"
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.
A boolean that specifies whether to overwrite the existing template. The default is false.

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.


setup.template.name: "winlogbeat"
setup.template.fields: "fields.yml"
setup.template.overwrite: false
  index.number_of_shards: 1
  index.number_of_replicas: 1

If you want to use cross-cluster replication to replicate Winlogbeat indices to another cluster, you will need to add additional template settings to enable soft deletes on the underlying indices.


A dictionary of settings for the _source field. For the available settings, please see the Elasticsearch reference.


setup.template.name: "winlogbeat"
setup.template.fields: "fields.yml"
setup.template.overwrite: false
  _source.enabled: false
setup.template.append_fields [experimental] This functionality is experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features 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 Winlogbeat doesn’t know about in advance.

If append_fields is specified along with overwrite: true, Winlogbeat 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 Winlogbeat with different append_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
- name: test.name
  type: keyword
- name: test.hostname
  type: long

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.