Skip to content

Commit

Permalink
Do not require template if index change and template disabled (elasti…
Browse files Browse the repository at this point in the history
…c#5319)

* Do not require template if index change and template disabled

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

* Add Changelog
  • Loading branch information
ruflin authored and tsg committed Oct 5, 2017
1 parent 9a431f1 commit ce9e47b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ https://github.com/elastic/beats/compare/v6.0.0-beta2...master[Check the HEAD di

- Fix data race accessing watched containers. {issue}5147[5147]
- Remove ID() from Runner interface {issue}5153[5153]
- Do not require template if index change and template disabled {pull}5319[5319]

*Auditbeat*

Expand Down
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 ce9e47b

Please sign in to comment.