Cleanup load.sh script.
authordrebs <drebs@riseup.net>
Tue, 18 Apr 2017 15:39:52 +0000 (17:39 +0200)
committerdrebs <drebs@riseup.net>
Tue, 18 Apr 2017 15:39:52 +0000 (17:39 +0200)
elastic/load.sh

index f46466a..c68634b 100755 (executable)
@@ -13,7 +13,6 @@
 ELASTICSEARCH=http://localhost:9200
 CURL='curl --netrc'
 KIBANA_INDEX=".kibana"
-BEAT_CONFIG=".beatconfig"
 
 print_usage() {
   echo "
@@ -86,35 +85,21 @@ esac
 shift 2
 done
 
-if [ -f ${BEAT_CONFIG} ]; then
-  for ln in `cat ${BEAT_CONFIG}`; do
-    BUILD_STRING="${BUILD_STRING}s/${ln}/g;"
-  done
-  SED_STRING=`echo ${BUILD_STRING} | sed 's/;$//'`
-fi
-# Failsafe
-if [ -z ${SED_STRING} ]; then
-  SED_STRING="s/packetbeat-/packetbeat-/g;s/filebeat-/filebeat-/g;s/topbeat-/topbeat-/g;s/winlogonbeat-/winlogonbeat-/g"
-fi
-
 DIR=.
 echo "Loading dashboards to ${ELASTICSEARCH} in ${KIBANA_INDEX}"
 
 # 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"}}}}'
+#${CURL} -XPUT "${ELASTICSEARCH}/${KIBANA_INDEX}"
+#${CURL} -XPUT "${ELASTICSEARCH}/${KIBANA_INDEX}/_mapping/search" -d'{"search": {"properties": {"hits": {"type": "integer"}, "version": {"type": "integer"}}}}'
 
-TMP_SED_FILE="${DIR}/search/tmp_search.json"
 for file in ${DIR}/search/*.json
 do
     NAME=`basename ${file} .json`
     echo "Loading search ${NAME}:"
-    sed ${SED_STRING} ${file} > ${TMP_SED_FILE}
     ${CURL} -XPUT ${ELASTICSEARCH}/${KIBANA_INDEX}/search/${NAME} \
-        -d @${TMP_SED_FILE} || exit 1
+        -d @${file} || exit 1
     echo
 done
-rm ${TMP_SED_FILE}
 
 for file in ${DIR}/index-pattern/*.json
 do