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

Add support to export dashboard to Beat #7239

Merged
merged 3 commits into from
Jun 4, 2018

Conversation

ruflin
Copy link
Contributor

@ruflin ruflin commented Jun 1, 2018

Currently to export a Dashboard from the Kibana exporter API it has to be done manually or the Beats repository must be used. To simplify the exporting of own dashboards the command beat export dashboard --id="dashboard-id" is added. This should allow all users to export their own dashboards.

The output is written to stdout, so the expected usage is to pipe it into a file inside the kibana/dashboards/6 directory.

For the Kibana connection settings it uses the setting from setup.kibana.*. If none are set it uses the defaults.

@@ -246,6 +246,22 @@ func (client *Client) ImportJSON(url string, params url.Values, jsonBody map[str

func (client *Client) Close() error { return nil }

// GetDashboard returns the dashboard with the given id with the index pattern removed
func (c *Client) GetDashboard(id string) (common.MapStr, error) {

Choose a reason for hiding this comment

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

receiver name c should be consistent with previous receiver name client for Client

@ruflin ruflin force-pushed the improve-dashboard-exporter branch from 05aa12a to 6e61482 Compare June 1, 2018 10:43
Currently to export a Dashboard from the Kibana exporter API it has to be done manually or the Beats repository must be used. To simplify the exporting of own dashboards the command `beat export dashboard --id="dashboard-id"` is added. This should allow all users to export their own dashboards.

The output is written to stdout, so the expected usage is to pipe it into a file inside the `kibana/dashboards/6` directory.

For the Kibana connection settings it uses the setting from `setup.kibana.*`. If none are set it uses the defaults.
@ruflin ruflin force-pushed the improve-dashboard-exporter branch from 6e61482 to 373245d Compare June 1, 2018 10:43
@ruflin
Copy link
Contributor Author

ruflin commented Jun 1, 2018

@dedemorton I was not sure where I should put the docs for this one. Suggestions?

@dedemorton
Copy link
Contributor

@ruflin There are a few places where we should talk about exporting dashboards:

  • Update the content about the export command here: Make sure you also update the short description at the beginning of the topic. (I wish asciidoc had support for proper railroad track style syntax diagrams because one would be useful here. The examples help with the syntax, tho, so make sure you add one for export dashboards.)

  • In the Beats Developer Guide, add a new section called something like "Exporting dashboards to stdout or a file" to the existing topic here. You'll need to rework the intro a bit.

  • In a couple of places where we talk about the dashboards (for example, here and here), add a tip to tell users that they can export the dashboards after customizing them, and point to the developer guide for more info.

TBH, I think we have overloaded the getting started topics in the reference guide. We should have a separate section that tells users how to work with the assets (like dashboards) that Beats deploys. Customizing and exporting our dashboards isn't just a developer task, I think. Someday....

@dedemorton
Copy link
Contributor

note that I've created a related enhancement request here: #7243

@ruflin
Copy link
Contributor Author

ruflin commented Jun 4, 2018

@dedemorton Thanks for the pointers. Will open a follow up PR with the docs changes.

@jsoriano jsoriano merged commit ccd36fb into elastic:master Jun 4, 2018
@ruflin ruflin deleted the improve-dashboard-exporter branch June 4, 2018 07:44
ruflin added a commit to ruflin/beats that referenced this pull request Jun 4, 2018
In elastic#7239 support to export a dashboard is a added to each Beat. This is expected to be used by users. The export_dashboard script from the Beats repository is expected by the Devs and contributors which want to add new dashboards.

In elastic#7224 the dashboards are modified to be stored with decoded json objects for better versioning. This change modifies the export dashboard script so it generates the same decoded output so no additional conversion is needed.

Note: The export_dashboard script could need some cleanup but I didn't tackle this in this PR and leave it for later to keep the change to a minimum.
jsoriano pushed a commit that referenced this pull request Jun 4, 2018
In #7239 support to export a dashboard is a added to each Beat. This is expected to be used by users. The export_dashboard script from the Beats repository is expected by the Devs and contributors which want to add new dashboards.

In #7224 the dashboards are modified to be stored with decoded json objects for better versioning. This change modifies the export dashboard script so it generates the same decoded output so no additional conversion is needed.
ruflin added a commit to ruflin/beats that referenced this pull request Jul 24, 2018
dedemorton pushed a commit that referenced this pull request Aug 16, 2018
* Add document for beat export dashboard

Follow up from #7239

* move to command reference

* address review comments

* review comments applied

* apply review feedback
dedemorton pushed a commit to dedemorton/beats that referenced this pull request Aug 17, 2018
* Add document for beat export dashboard

Follow up from elastic#7239

* move to command reference

* address review comments

* review comments applied

* apply review feedback
dedemorton pushed a commit to dedemorton/beats that referenced this pull request Aug 30, 2018
* Add document for beat export dashboard

Follow up from elastic#7239

* move to command reference

* address review comments

* review comments applied

* apply review feedback
dedemorton pushed a commit to dedemorton/beats that referenced this pull request Aug 31, 2018
* Add document for beat export dashboard

Follow up from elastic#7239

* move to command reference

* address review comments

* review comments applied

* apply review feedback
dedemorton added a commit that referenced this pull request Sep 4, 2018
…7937 #7939 #7948 #7949 #7950)  (#8188)

* Reset modulename attribute at the end of a file (#7888)

* Add safeguard related statements for max_backoff setting (#7889)

* Add docs about append_fields (#7903)

* Add docs about append_fields
* Remove experimental tag from setup.template.json.enabled description

* Metricbeat: Add compatibility notes where missing (#7939)

* Metricbeat: Add compatibility notes where missing, based on integration tests

* Added review suggestions

* Add missing config options to Logstash section of reference.yml (#7883)

Closes #3062

* Fix processor autodiscovery docs for Filebeat (#7937)

{ needs escaping as otherwise asciidoc will show an empty code block.

* Add document for beat export dashboard (#7696)

* Add document for beat export dashboard

Follow up from #7239

* move to command reference

* address review comments

* review comments applied

* apply review feedback

* Replace golang with Go (#7948)

I've been told that using "golang" instead of "Go" is considered a faux pas in some circles. :-)

I've replaced instances in the external docs, but I did not update the changelog, readmes, or code files.

* Minor fixes to attributes in module docs (#7949)

* Add recommendation to avoid harvesting symlinks when dealing with file rotation (#7950)
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.

5 participants