Fix Kibana Script for loading dashboards

This commit is contained in:
Mike Reeves
2021-03-08 17:36:07 -05:00
parent bf4ac2a312
commit 1ecb079066
4 changed files with 11 additions and 9 deletions
+10 -1
View File
@@ -14,5 +14,14 @@ cp /opt/so/conf/kibana/saved_objects.ndjson.template /opt/so/conf/kibana/saved_o
# SOCtopus and Manager
sed -i "s/PLACEHOLDER/{{ MANAGER }}/g" /opt/so/conf/kibana/saved_objects.ndjson
## This hackery will be removed with Elastic Auth ##
# Remove the cold cookie if its there
rm /tmp/cookie.txt
# Let's snag a cookie from Kibana
curl -c /tmp/cookie.txt -X GET http://localhost:5601/
THECOOKIE=$(cat /tmp/cookie.txt | grep sid | awk '{print $7}')
# Load saved objects
curl -X POST "localhost:5601/api/saved_objects/_import?overwrite=true" -H "kbn-xsrf: true" --form file=@/opt/so/conf/kibana/saved_objects.ndjson > /dev/null 2>&1
curl -b "sid=$THECOOKIE" -L -X POST "localhost:5601/api/saved_objects/_import?overwrite=true" -H "kbn-xsrf: true" --form file=@/opt/so/conf/kibana/saved_objects.ndjson > /dev/null 2>&1