Skip to content

Commit 7a7279f

Browse files
authored
Don't swallow Kibana index pattern errors (#20121)
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.
1 parent e5d0373 commit 7a7279f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.next.asciidoc

+1
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
148148
- Fix metrics hints builder to avoid wrong container metadata usage when port is not exposed {pull}18979[18979]
149149
- Server-side TLS config now validates certificate and key are both specified {pull}19584[19584]
150150
- Fix seccomp policy for calls to `chmod` and `chown`. {pull}20054[20054]
151+
- Output errors when Kibana index pattern setup fails. {pull}20121[20121]
151152

152153
*Auditbeat*
153154

libbeat/dashboards/importer.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,9 @@ func (imp Importer) ImportKibanaDir(dir string) error {
305305

306306
// Loads the internal index pattern
307307
if imp.fields != nil {
308-
imp.loader.ImportIndex(imp.fields)
308+
if err = imp.loader.ImportIndex(imp.fields); err != nil {
309+
return errw.Wrap(err, "failed to import Kibana index pattern")
310+
}
309311
}
310312

311313
dir = path.Join(dir, versionPath)

0 commit comments

Comments
 (0)