Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-pick #8045 to 6.x: Support Kibana Spaces #8545

Merged
merged 1 commit into from
Oct 4, 2018
Merged

Cherry-pick #8045 to 6.x: Support Kibana Spaces #8545

merged 1 commit into from
Oct 4, 2018

Conversation

ycombinator
Copy link
Contributor

Cherry-pick of PR #8045 to 6.x branch. Original message:

Resolves #7942.

Kibana is implementing a new feature called Spaces, in which Kibana saved objects (such as dashboards) and advanced settings can be restricted to a user-defined namespace. Spaces are identified by a unique ID, e.g. my-space. There is also a notion of a Default space which corresponds to how Kibana worked up until the Spaces feature was introduced.

Beats have the ability to import dashboards into Kibana as well as export dashboards out of Kibana. With Spaces, dashboards may belong to a specific space. So Beats must learn to accept an optional Space ID and operate against it when importing or exporting dashboards. This PR teaches Beats to do just that.

Concretely, if a user wishes to import or export dashboards from a specific space, say with ID = my-space, they must either:

  • Edit <beat>.yml and set setup.kibana.space.id: my-space, or
  • Run <beat> setup or <beat> export dashboard along with the -E setup.kibana.space.id=my-space option.

Similarly, if a Beat developer wishes to export dashboards from a specific space, say with ID = my-space, they must run:

go run dev-tools/cmd/dashboards/export_dashboards.go -space-id my-space [other options]

@@ -48,11 +49,14 @@ func makeURL(url, path string, params url.Values) string {
return strings.Join([]string{url, path, "?", params.Encode()}, "")
}

func Export(client *http.Client, conn string, dashboard string, out string) error {
func Export(client *http.Client, conn string, spaceID string, dashboard string, out string) error {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported function Export should have comment or be unexported

* Support Kibana Spaces via setup.kibana.space.id setting

* Adding CHANGELOG entry

* Add space-id option to export_dashboards script

* Add integration tests for importing and exporting dashboards with space ID

* Adding -space-id option for export_dashboards.go to documentation

* Adding entry to dev CHANGELOG

* Prefix space path with /

* Create Kibana space before trying to use it

* Make spaces tests conditional on version

* Add semver to requirements.txt

* Add kbn-xsrf header to POST request

* Don't recreate space in second space test

(cherry picked from commit 2a04e2c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants