Skip to content

Commit

Permalink
Update Filebeat development guide && create _meta/kibana/default fold…
Browse files Browse the repository at this point in the history
…er (#4787) (#4886)

* create_fileset: Create kibana/default folder

kibana/default folder is created under _meta to be
more consistent with the development guide.

* filebeat: update development guide on dashboards

The way dashboards are exported has changed, so it followed up
in the development guide. It also includes the export of dashboards
before 6.x.
  • Loading branch information
kvch authored and tsg committed Aug 14, 2017
1 parent 695f923 commit cc71fa1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
19 changes: 17 additions & 2 deletions docs/devguide/modules-dev-guide.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ module/{module}/{fileset}
│   └── pipeline.json
├── _meta
│   └── fields.yml
│   └── kibana
│    └── default
└── test
----

Expand Down Expand Up @@ -306,11 +308,24 @@ them, you can build them visually in Kibana and then run the following command:

[source,shell]
----
$ cd filebeat/module/{module}/
python ../../../dev-tools/export_dashboards.py --regex {module} --dir _meta/kibana
$ cd dev-tools/cmd/dashboards
$ make # if export_dashboard is not built
$ ./export_dashboards -dashboard '{dashboard-id}' -output '../../../filebeat/module/{module}/_meta/kibana/default/dashboard'
----

New Filebeat modules might not be compatible with Kibana 5.x. To export dashboards that are compatible with 5.x, run the following command inside the developer virtualenv:

[source,shell]
----
$ cd filebeat
$ make python-env
$ cd module/{module}/
$ python ../../../dev-tools/export_5x_dashboards.py --regex {module} --dir _meta/kibana/5.x
----

Where the `--regex` parameter should match the dashboard you want to export.

Please note that dashboards exported from Kibana 5.x are not compatible with Kibana 6.x.

You can find more details about the process of creating and exporting the Kibana
dashboards by reading {beatsdevguide}/new-dashboards.html[this guide].
5 changes: 4 additions & 1 deletion filebeat/scripts/create_fileset.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,16 @@ def generate_module(base_path, metricbeat_path, module, fileset):

module_path = base_path + "/module/" + module
meta_path = module_path + "/_meta"
kibana_default_path = meta_path + "/kibana/default"

if os.path.isdir(module_path):
print("Module already exists. Skipping creating module {}"
.format(module))
return

os.makedirs(meta_path)
paths_to_create = [meta_path, kibana_default_path]
for path_to_create in paths_to_create:
os.makedirs(path_to_create)

templates = metricbeat_path + "/scripts/module/"

Expand Down

0 comments on commit cc71fa1

Please sign in to comment.