Cherry-pick #9097 to 6.x: Unify dashboard exporter tools#9250
Merged
kvch merged 1 commit intoelastic:6.xfrom Nov 27, 2018
Merged
Cherry-pick #9097 to 6.x: Unify dashboard exporter tools#9250kvch merged 1 commit intoelastic:6.xfrom
kvch merged 1 commit intoelastic:6.xfrom
Conversation
The existing `export_dashboards.go` and the command `export dashboards` are unified, using the same code and slightly different logic. Configuration of `export_dashboards` is done using the following command line options: `-kibana`, `-space`, `-output`, `-quiet` and `-index-pattern`. The last flag is an odd one out, because it is part of the script, but its value is never used. So far no one complained, so I did not port it. The default value of that flag is the same in case of both methods.
Configuration the Kibana client of `export dashboard` is read from the config of the Beat. Thus, Kibana-related flags are not part of its CLI.
By default `export dashboard` does not decode the exported dashboard. If flag `-decode` passed to the command, the dashboard is decoded.
export dashboards from a dashboards.yml
```
$ ./filebeat export dashboard -yml path/to/dashboards.yml -decode
$ go run dev-tools/cmd/dashboards/export_dashboards.go -yml path/to/dashboards.yml
```
export a dashboard with an id and print to stdout
```
$ ./filebeat export dashboard -id {uuid} -decode
$ go run dev-tools/cmd/dashboards/export_dashboards.go -dashboard {uuid}
```
(cherry picked from commit 1411852)
a8d9c47 to
e61c84b
Compare
ph
approved these changes
Nov 27, 2018
Contributor
Author
|
Failing tests are unrelated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-pick of PR #9097 to 6.x branch. Original message:
The existing
export_dashboards.goand the commandexport dashboardsare unified, using the same code and slightly different logic. Configuration ofexport_dashboardsis done using the following command line options:-kibana,-space,-output,-quietand-index-pattern. The last flag is an odd one out, because it is part of the script, but its value is never used. So far no one complained, so I did not port it. The default value of that flag is the same in case of both methods.Configuration the Kibana client of
export dashboardis read from the config of the Beat. Thus, Kibana-related flags are not part of its CLI.By default
export dashboarddoes not decode the exported dashboard. If flag-decodepassed to the command, the dashboard is decoded.Equivalent commands
export dashboards from a dashboards.yml
export a dashboard with an id and print to stdout
The interface of
export dashboardis different than in the previous PR, because I wanted to follow existing methods and documentation.TODO
export dashboardoption to dev docs