summaryrefslogtreecommitdiff
path: root/elastic/load.sh
diff options
context:
space:
mode:
authordrebs <drebs@riseup.net>2017-07-17 08:53:24 -0300
committerdrebs <drebs@riseup.net>2017-07-17 08:53:24 -0300
commit2cf09ffecd09d7e19d8a8da8b7914ac04d9986af (patch)
tree1f89ede3864c306390abc9b2f173abb29d5a8897 /elastic/load.sh
parentdb58596f7abee94156fae3d5ce53e17e416c372d (diff)
[elastic] remove all elastic-related stuff
All this was moved to the puppet repository so kibana is autoconfigured and the website is autogenerated.
Diffstat (limited to 'elastic/load.sh')
-rwxr-xr-xelastic/load.sh144
1 files changed, 0 insertions, 144 deletions
diff --git a/elastic/load.sh b/elastic/load.sh
deleted file mode 100755
index 8328ac3..0000000
--- a/elastic/load.sh
+++ /dev/null
@@ -1,144 +0,0 @@
-#!/bin/bash
-#
-# from https://raw.githubusercontent.com/elastic/beats-dashboards/master/load.sh
-
-
-# Usage examples:
-# env KIBANA_INDEX='.kibana_env1' ./load.sh
-# ./load.sh -url http://test.com:9200
-# ./load.sh -url http://test.com:9200 -user admin:secret
-# ./load.sh -url http://test.com:9200 -index .kibana-test
-
-# Todo:
-#
-# - Delete all objects so a test can get removed
-
-
-# The default value of the variable. Initialize your own variables here
-ELASTICSEARCH=http://localhost:9200
-CURL='curl --netrc'
-KIBANA_INDEX=".kibana"
-
-print_usage() {
- echo "
-
-Load the dashboards, visualizations and index patterns into the given
-Elasticsearch instance.
-
-Usage:
- $(basename "$0") -url ${ELASTICSEARCH} -user admin:secret -index ${KIBANA_INDEX}
-
-Options:
- -h | -help
- Print the help menu.
- -l | -url
- Elasticseacrh URL. By default is ${ELASTICSEARCH}.
- -u | -user
- Username and password for authenticating to Elasticsearch using Basic
- Authentication. The username and password should be separated by a
- colon (i.e. "admin:secret"). By default no username and password are
- used.
- -i | -index
- Kibana index pattern where to save the dashboards, visualizations,
- index patterns. By default is ${KIBANA_INDEX}.
-
-" >&2
-}
-
-while [ "$1" != "" ]; do
-case $1 in
- -l | -url )
- ELASTICSEARCH=$2
- if [ "$ELASTICSEARCH" = "" ]; then
- echo "Error: Missing Elasticsearch URL"
- print_usage
- exit 1
- fi
- ;;
-
- -u | -user )
- USER=$2
- if [ "$USER" = "" ]; then
- echo "Error: Missing username"
- print_usage
- exit 1
- fi
- CURL="${CURL} --user ${USER}"
- ;;
-
- -i | -index )
- KIBANA_INDEX=$2
- if [ "$KIBANA_INDEX" = "" ]; then
- echo "Error: Missing Kibana index pattern"
- print_usage
- exit 1
- fi
- ;;
-
- -h | -help )
- print_usage
- exit 0
- ;;
-
- *)
- echo "Error: Unknown option $2"
- print_usage
- exit 1
- ;;
-
-esac
-shift 2
-done
-
-DIR=.
-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}"
-#${CURL} -XPUT "${ELASTICSEARCH}/${KIBANA_INDEX}/_mapping/search" -d'{"search": {"properties": {"hits": {"type": "integer"}, "version": {"type": "integer"}}}}'
-
-for file in ${DIR}/search/*.json
-do
- NAME=`basename ${file} .json`
- 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 -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 -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 -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