From 0da8233146b474fc4f82c4099acce06e1443b1de Mon Sep 17 00:00:00 2001 From: varac Date: Thu, 20 Apr 2017 18:27:46 +0200 Subject: Increment Panel index again --- elastic/generate-config.py | 3 ++- elastic/load.sh | 16 +++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'elastic') diff --git a/elastic/generate-config.py b/elastic/generate-config.py index b935cb6..2978976 100755 --- a/elastic/generate-config.py +++ b/elastic/generate-config.py @@ -45,7 +45,7 @@ def generate_dashboards(): count = 0 for test_name in tests: count += 1 - panels += '{\\"id\\":\\"' + test_name + '\\",\\"panelIndex\\":1,\\"col\\":1,\\"row\\":' + str(count) + ',\\"size_x\\":6,\\"size_y\\":3,\\"type\\":\\"visualization\\"}, ' + panels += '{\\"id\\":\\"' + test_name + '\\",\\"panelIndex\\":' + str(count) + ',\\"col\\":1,\\"row\\":' + str(count) + ',\\"size_x\\":6,\\"size_y\\":3,\\"type\\":\\"visualization\\"}, ' panels = panels[:-2] panels += ']' @@ -72,4 +72,5 @@ for d in buckets: tests = sorted(tests) generate_dashboards() +print() generate_visualizations() diff --git a/elastic/load.sh b/elastic/load.sh index c68634b..9b9f664 100755 --- a/elastic/load.sh +++ b/elastic/load.sh @@ -86,7 +86,8 @@ shift 2 done DIR=. -echo "Loading dashboards to ${ELASTICSEARCH} in ${KIBANA_INDEX}" +echo "Loading json config files to ${ELASTICSEARCH} in ${KIBANA_INDEX}" +echo # Workaround for: https://github.com/elastic/beats-dashboards/issues/94 #${CURL} -XPUT "${ELASTICSEARCH}/${KIBANA_INDEX}" @@ -95,39 +96,44 @@ echo "Loading dashboards to ${ELASTICSEARCH} in ${KIBANA_INDEX}" for file in ${DIR}/search/*.json do NAME=`basename ${file} .json` - echo "Loading search ${NAME}:" + echo -n "Loading search ${NAME}: " ${CURL} -XPUT ${ELASTICSEARCH}/${KIBANA_INDEX}/search/${NAME} \ -d @${file} || exit 1 echo done +echo for file in ${DIR}/index-pattern/*.json do NAME=`awk '$1 == "\"title\":" {gsub(/[",]/, "", $2); print $2}' ${file}` - echo "Loading index pattern ${NAME}:" + echo -n "Loading index pattern ${NAME}: " ${CURL} -XPUT ${ELASTICSEARCH}/${KIBANA_INDEX}/index-pattern/${NAME} \ -d @${file} || exit 1 echo done +echo for file in ${DIR}/dashboard/*.json do NAME=`basename ${file} .json` - echo "Loading dashboard ${NAME}:" + echo -n "Loading dashboard ${NAME}: " ${CURL} -XPUT ${ELASTICSEARCH}/${KIBANA_INDEX}/dashboard/${NAME} \ -d @${file} || exit 1 echo done +echo for file in ${DIR}/visualization/*.json do NAME=`basename ${file} .json` - echo "Loading visualization ${NAME}:" + echo -n "Loading visualization ${NAME}: " ${CURL} -XPUT ${ELASTICSEARCH}/${KIBANA_INDEX}/visualization/${NAME} \ -d @${file} || exit 1 echo done +echo # Clear cache +echo "Clearing the cache:" ${CURL} -XPOST ${ELASTICSEARCH}/_cache/clear -- cgit v1.2.3