Skip to content

Commit

Permalink
Don't swallow Kibana index pattern errors (#20121) (#20194)
Browse files Browse the repository at this point in the history
While running 'beat setup --dashboads' any errors that occur while importing the generated Kibana index pattern or silently ignored.
This changes that by causing the dashboard setup to stop and return the error. Dashboards won't work without the index pattern anyways.

(cherry picked from commit 7a7279f)
  • Loading branch information
andrewkroh authored Jul 23, 2020
1 parent f07440d commit 66d7ac2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Change `decode_json_fields` processor, to merge parsed json objects with existing objects in the event instead of fully replacing them. {pull}17958[17958]
- Fix terminating pod autodiscover issue. {pull}20084[20084]
- Fix seccomp policy for calls to `chmod` and `chown`. {pull}20054[20054]
- Output errors when Kibana index pattern setup fails. {pull}20121[20121]

*Auditbeat*

Expand Down
4 changes: 3 additions & 1 deletion libbeat/dashboards/importer.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,9 @@ func (imp Importer) ImportKibanaDir(dir string) error {

// Loads the internal index pattern
if imp.fields != nil {
imp.loader.ImportIndex(imp.fields)
if err = imp.loader.ImportIndex(imp.fields); err != nil {
return errw.Wrap(err, "failed to import Kibana index pattern")
}
}

dir = path.Join(dir, versionPath)
Expand Down

0 comments on commit 66d7ac2

Please sign in to comment.