Skip to content

Commit

Permalink
Do not require template if index change and template disabled
Browse files Browse the repository at this point in the history
If the elasticsearch index name is changed, its required to set a template. The error message was also shown when template itself are disabled. This is now changed that if templates are disabled, no error is returned.

Closes elastic#5308
  • Loading branch information
ruflin committed Oct 4, 2017
1 parent 16be171 commit 827e5e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libbeat/cmd/instance/beat.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,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.")
}

Expand Down

0 comments on commit 827e5e7

Please sign in to comment.