Skip to content

Cherry-pick #9097 to 6.x: Unify dashboard exporter tools#9250

Merged
kvch merged 1 commit intoelastic:6.xfrom
kvch:backport_9097_6.x
Nov 27, 2018
Merged

Cherry-pick #9097 to 6.x: Unify dashboard exporter tools#9250
kvch merged 1 commit intoelastic:6.xfrom
kvch:backport_9097_6.x

Conversation

@kvch
Copy link
Copy Markdown
Contributor

@kvch kvch commented Nov 27, 2018

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

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.

Equivalent commands

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}

The interface of export dashboard is different than in the previous PR, because I wanted to follow existing methods and documentation.

TODO

  • add automated tests
  • add new export dashboard option to dev docs

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)
@kvch kvch force-pushed the backport_9097_6.x branch from a8d9c47 to e61c84b Compare November 27, 2018 11:36
@kvch
Copy link
Copy Markdown
Contributor Author

kvch commented Nov 27, 2018

Failing tests are unrelated.

@kvch kvch merged commit 5a42524 into elastic:6.x Nov 27, 2018
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.

2 participants