From 89ab6dd3ff7339243a9ec81712d180a495ccd9bc Mon Sep 17 00:00:00 2001 From: Silvia Mitter Date: Wed, 21 Nov 2018 09:02:17 +0100 Subject: [PATCH] kibana: fix sync check for Kibana index pattern. (#1571) * kibana: fix sync check for Kibana index pattern. fixes #1570 --- changelogs/head.asciidoc | 2 ++ script/are_kibana_saved_objects_updated.py | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/changelogs/head.asciidoc b/changelogs/head.asciidoc index 738f362a2e9..d02020edb22 100644 --- a/changelogs/head.asciidoc +++ b/changelogs/head.asciidoc @@ -12,3 +12,5 @@ https://github.com/elastic/apm-server/compare/6.5\...6.x[View commits] [float] ==== Bug fixes + +- Fix index pattern bundled with Kibana to be in sync with ES template pull{1571}[1571]. diff --git a/script/are_kibana_saved_objects_updated.py b/script/are_kibana_saved_objects_updated.py index 98738c4034f..f49b1919ff8 100755 --- a/script/are_kibana_saved_objects_updated.py +++ b/script/are_kibana_saved_objects_updated.py @@ -81,8 +81,10 @@ def iterate(val_id, key, v1, v2): for item1, item2 in zip(v1, v2): ret_val = max(ret_val, iterate(val_id, key, *json_val(item1, item2))) else: - d = jsondiff.diff(*json_val(v1, v2)) + d = jsondiff.JsonDiffer(syntax='symmetric').diff(*json_val(v1, v2)) if d: + if key == "attributes.title": + return ret_val ret_val = 2 print("Difference for id '{}' for key '{}'".format(val_id, key)) try: @@ -126,6 +128,9 @@ def main(): exit_val = max(exit_val, iterate(k["id"], "", s, k)) if exit_val == 0: print("up-to-date") + if "title" in k["attributes"]: + print("`title` need to be set dynamically, remove it from the index-pattern!") + exit_val = 3 return exit_val