icingabeat/vendor/github.com/elastic/beats/libbeat/docs/template-config.asciidoc
2017-12-19 13:16:39 +01:00

81 lines
3.4 KiB
Plaintext

[[configuration-template]]
== Load the Elasticsearch index template
The `setup.template` section of the +{beatname_lc}.yml+ config file specifies
the {elasticsearch}/indices-templates.html[index template] to use for setting
mappings in Elasticsearch. If template loading is enabled (the default),
{beatname_uc} loads the index template automatically after successfully
connecting to Elasticsearch.
NOTE: A connection to Elasticsearch is required to load the index template. If
the output is Logstash, you must <<load-template-manually,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-template-manually,load the template manually>>.
*`setup.template.name`*:: The name of the template. The default is
+{beatname_lc}+. The Beat version is always appended to the given
name, so the final name is +{beatname_lc}-%\{[beat.version]\}+.
// Maintainers: a backslash character is required to escape curly braces and
// asterisks in inline code examples that contain asciidoc attributes. You'll
// note that a backslash does not appear before the asterisk
// in +{beatname_lc}-%\{[beat.version]\}-*+. This is intentional and formats
// the example as expected.
*`setup.template.pattern`*:: The template pattern to apply to the default index
settings. The default pattern is +{beatname_lc}-\*+. The Beat version is always
included in the pattern, so the final pattern is
+{beatname_lc}-%\{[beat.version]\}-*+. The wildcard character `-*` is used to
match all daily indices.
+
Example:
+
["source","yaml",subs="attributes"]
----------------------------------------------------------------------
setup.template.name: "{beatname_lc}"
setup.template.pattern: "{beatname_lc}-*"
----------------------------------------------------------------------
*`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 {elasticsearch}/mapping.html[mapping reference].
+
Example:
+
["source","yaml",subs="attributes"]
----------------------------------------------------------------------
setup.template.name: "{beatname_lc}"
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 {elasticsearch}/mapping-source-field.html[reference].
+
Example:
+
["source","yaml",subs="attributes"]
----------------------------------------------------------------------
setup.template.name: "{beatname_lc}"
setup.template.fields: "fields.yml"
setup.template.overwrite: false
setup.template.settings:
_source.enabled: false
----------------------------------------------------------------------