Skip to content

Commit

Permalink
Add document for beat export dashboard
Browse files Browse the repository at this point in the history
Follow up from elastic#7239
  • Loading branch information
ruflin committed Jul 24, 2018
1 parent db8dac8 commit 19d293d
Showing 1 changed file with 27 additions and 11 deletions.
38 changes: 27 additions & 11 deletions docs/devguide/newdashboards.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ For more details about the `setup` command, run the following:

[source,shell]
-------------------------
./metricbeat help setup
./metricbeat help setup
This command does initial setup of the environment:
* Index mapping template in Elasticsearch to ensure fields are mapped.
Expand Down Expand Up @@ -171,13 +171,13 @@ default is `metricbeat-*`, you can change it to `custombeat-*`.
[[build-dashboards]]
=== Building Your Own Beat Dashboards

NOTE: If you want to modify a dashboard that comes with a Beat, it's better to modify a copy of the dashboard because the Beat overwrites the dashboards during the setup phase in order to have the latest version. For duplicating a dashboard, just use the `Clone` button from the top of the page.
NOTE: If you want to modify a dashboard that comes with a Beat, it's better to modify a copy of the dashboard because the Beat overwrites the dashboards during the setup phase in order to have the latest version. For duplicating a dashboard, just use the `Clone` button from the top of the page.


Before building your own dashboards or customizing the existing ones, you need to load:

* the Beat index pattern, which specifies how Kibana should display the Beat fields
* the Beat dashboards that you want to customize
* the Beat dashboards that you want to customize

For the Elastic Beats, the index pattern is available in the Beat package under
`kibana/*/index-pattern`. The index-pattern is automatically generated from the `fields.yml` file, available in the Beat package. For more details
Expand Down Expand Up @@ -209,10 +209,26 @@ make update

To export all the dashboards for any Elastic Beat or any community Beat, including any new or modified dashboards and all dependencies such as
visualizations, searches, you can use the Golang script `export_dashboards.go` from
https://github.com/elastic/beats/tree/master/dev-tools/cmd/dashboards[dev-tools] for exporting Kibana 6.0 dashboards or later, and the Python script `export_5x_dashboards.py`
https://github.com/elastic/beats/tree/master/dev-tools/cmd/dashboards[dev-tools] for exporting Kibana 6.0 dashboards or later, and the Python script `export_5x_dashboards.py`
for exporting Kibana 5.x dashboards. See the dev-tools
https://github.com/elastic/beats/tree/master/dev-tools/README.md[readme] for more info.

If you only want to export a single dashboard based on the dashboard id you can do it with the Beats binary:

[source,shell]
----
$ filebeat export dashboard --id="dashboard-id" > dashboard.json
----

By default it will write the dashboard to stdout. Above we write it into `dashboard.json` so we can later import the
dashboard. The file contains the dashboard with all visualizations and searches but the index pattern are removed
as they are expected to be loaded separately for a Beat.

The generate `dashboard.json` file can be copied into the `kibana/6/dashboard` directory of any Beat and next time
`filebeat setup dashboards` is called it will be imported automatically.

In case Kibana is not running on `localhost:5061` the Beat configuration under `setup.kibana` must be adjusted.

/////////////////////
NOT YET IMPLEMENTED
NOTE: You can make use of the Makefile from the Beat GitHub repository to export all the Kibana dashboards for a Beat
Expand All @@ -234,7 +250,7 @@ ES_URL="http://192.168.3.206:9200" make export-dashboards

==== Exporting Kibana 6.0 dashboards and newer

The `dev-tools/cmd/export_dashboards.go` script helps you export your customized Kibana 6.0 dashboards and newer. You might need to export a single dashboard or all the dashboards available for a module or Beat.
The `dev-tools/cmd/export_dashboards.go` script helps you export your customized Kibana 6.0 dashboards and newer. You might need to export a single dashboard or all the dashboards available for a module or Beat.


===== Export a single Kibana dashboard
Expand All @@ -250,12 +266,12 @@ cd filebeat/module/redis/_meta/kibana/default/dashboard
go run ../../../../../../../dev-tools/cmd/dashboards/export_dashboards.go -dashboard 7fea2930-478e-11e7-b1f0-cb29bac6bf8b -output Filebeat-redis.json
---------------

This generates the `Filebeat-redis.json` file that contains the dashboard for the Redis module of Filebeat, including the dependencies (visualizations and searches).
This generates the `Filebeat-redis.json` file that contains the dashboard for the Redis module of Filebeat, including the dependencies (visualizations and searches).

===== Export all module/Beat dashboards
Each module should contain a `module.yml` file with a list of all the dashboards available for the module. For the Beats that don't have support for modules (e.g. Packetbeat),
there is a `dashboards.yml` file that defines all the Packetbeat dashboards.

Each module should contain a `module.yml` file with a list of all the dashboards available for the module. For the Beats that don't have support for modules (e.g. Packetbeat),
there is a `dashboards.yml` file that defines all the Packetbeat dashboards.

Below, it's an example of the `module.yml` file for the system module in Metricbeat:

Expand All @@ -273,7 +289,7 @@ dashboards:
---------------


Each dashboard is defined by an `id` and the name of json `file` where the dashboard is saved locally.
Each dashboard is defined by an `id` and the name of json `file` where the dashboard is saved locally.

By passing the yml file to the `export_dashboards.go` script, you can export all the dashboards defined:

Expand Down

0 comments on commit 19d293d

Please sign in to comment.