diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 1769d624f7f..34079435f7f 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -33,6 +33,7 @@ https://github.com/elastic/beats/compare/v6.0.0-rc1...master[Check the HEAD diff *Affecting all Beats* - Fix data race accessing watched containers. {issue}5147[5147] +- Do not require template if index change and template disabled {pull}5319[5319] *Auditbeat* diff --git a/libbeat/cmd/instance/beat.go b/libbeat/cmd/instance/beat.go index a69addce09d..e7636289acb 100644 --- a/libbeat/cmd/instance/beat.go +++ b/libbeat/cmd/instance/beat.go @@ -572,7 +572,7 @@ func (b *Beat) registerTemplateLoading() error { return err } - if esCfg.Index != "" && (cfg.Name == "" || cfg.Pattern == "") { + if esCfg.Index != "" && (cfg.Name == "" || cfg.Pattern == "") && (b.Config.Template == nil || b.Config.Template.Enabled()) { return fmt.Errorf("setup.template.name and setup.template.pattern have to be set if index name is modified.") }