Skip to content

Commit

Permalink
Introduce migration script for data in Kibana files (elastic#9998)
Browse files Browse the repository at this point in the history
With 7.x the data structure of the modules was changed to ECS. This has an affect on all Kibana files as the fields changed. For the migration from 6.x to 7.x it is necessary that 6.x and 7.x dashboards can coexist. To not overwrite dashboards in 7.x all Kibana files must have a changed id and to differentiate them in the UI, a different title.

This PR does the following changes:

* Reads all changed files from ecs-migration.yml and replaces these fields in all Kibana files. It also replaces fields inside queries and filters
* Reads all ids used in the Kibana files and postfixes these ids with `-7x`. It also replaces ids existing in links between dashboards.
* Reads all titles in the Kibana files and appends ` 7.x` to the titles.

The change is impemented so the script can be run multiple times. This is helpful if we make changes later on again to a few dashboards we can rerun the script without having double changes.
  • Loading branch information
ruflin authored Feb 5, 2019
1 parent 5cba0c5 commit 68abf76
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions _meta/kibana/7/dashboard/Journalbeat-overview.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,26 +59,26 @@
}
],
"timeRestore": false,
"title": "[Journalbeat] Overview",
"title": "[Journalbeat] Overview ECS",
"version": 1
},
"id": "effdfcd0-2877-11e9-bc7e-af96a8fe0ddd",
"id": "effdfcd0-2877-11e9-bc7e-af96a8fe0ddd-ecs",
"migrationVersion": {
"dashboard": "7.0.0"
},
"references": [
{
"id": "25251fc0-2877-11e9-bc7e-af96a8fe0ddd",
"id": "25251fc0-2877-11e9-bc7e-af96a8fe0ddd-ecs",
"name": "panel_0",
"type": "search"
},
{
"id": "52a2a1c0-2877-11e9-bc7e-af96a8fe0ddd",
"id": "52a2a1c0-2877-11e9-bc7e-af96a8fe0ddd-ecs",
"name": "panel_1",
"type": "search"
},
{
"id": "842a1340-2877-11e9-bc7e-af96a8fe0ddd",
"id": "842a1340-2877-11e9-bc7e-af96a8fe0ddd-ecs",
"name": "panel_2",
"type": "search"
}
Expand Down Expand Up @@ -113,10 +113,10 @@
"@timestamp",
"desc"
],
"title": "[Journalbeat] Kernel errors",
"title": "[Journalbeat] Kernel errors ECS",
"version": 1
},
"id": "25251fc0-2877-11e9-bc7e-af96a8fe0ddd",
"id": "25251fc0-2877-11e9-bc7e-af96a8fe0ddd-ecs",
"migrationVersion": {
"search": "7.0.0"
},
Expand Down Expand Up @@ -157,10 +157,10 @@
"@timestamp",
"desc"
],
"title": "[Journalbeat] Authorization",
"title": "[Journalbeat] Authorization ECS",
"version": 1
},
"id": "52a2a1c0-2877-11e9-bc7e-af96a8fe0ddd",
"id": "52a2a1c0-2877-11e9-bc7e-af96a8fe0ddd-ecs",
"migrationVersion": {
"search": "7.0.0"
},
Expand Down Expand Up @@ -200,10 +200,10 @@
"@timestamp",
"desc"
],
"title": "[Journalbeat] Systemd messages",
"title": "[Journalbeat] Systemd messages ECS",
"version": 1
},
"id": "842a1340-2877-11e9-bc7e-af96a8fe0ddd",
"id": "842a1340-2877-11e9-bc7e-af96a8fe0ddd-ecs",
"migrationVersion": {
"search": "7.0.0"
},
Expand Down

0 comments on commit 68abf76

Please sign in to comment.