diff --git a/dev-tools/cmd/dashboards/export_dashboards.go b/dev-tools/cmd/dashboards/export_dashboards.go index 5424f35361f..26dbc68d486 100644 --- a/dev-tools/cmd/dashboards/export_dashboards.go +++ b/dev-tools/cmd/dashboards/export_dashboards.go @@ -66,6 +66,7 @@ func main() { Host: u.Host, Username: user, Password: pass, + Path: u.Path, SpaceID: *spaceID, Timeout: kibanaTimeout, }) diff --git a/dev-tools/mage/dashboard.go b/dev-tools/mage/dashboard.go index 593b7184c3c..38f6a378e7a 100644 --- a/dev-tools/mage/dashboard.go +++ b/dev-tools/mage/dashboard.go @@ -36,6 +36,8 @@ func ExportDashboard() error { return fmt.Errorf("Dashboad ID must be specified") } + kibanaURL := EnvOr("KIBANA_URL", "") + beatsDir, err := ElasticBeatsDir() if err != nil { return err @@ -49,5 +51,9 @@ func ExportDashboard() error { "-output", file, "-dashboard", id, ) - return dashboardCmd() + if kibanaURL != "" { + return dashboardCmd("-kibana", kibanaURL) + } else { + return dashboardCmd() + } } diff --git a/libbeat/kibana/client.go b/libbeat/kibana/client.go index 115a1bffc29..d759ad432fb 100644 --- a/libbeat/kibana/client.go +++ b/libbeat/kibana/client.go @@ -217,8 +217,8 @@ func (client *Client) readVersion() error { code, result, err := client.Connection.Request("GET", "/api/status", nil, nil, nil) if err != nil || code >= 400 { - return fmt.Errorf("HTTP GET request to /api/status fails: %v. Response: %s.", - err, truncateString(result)) + return fmt.Errorf("HTTP GET request to %s/api/status fails: %v. Response: %s.", + client.Connection.URL, err, truncateString(result)) } var versionString string