From 49258a13a39b07e70135a459ac54df1eb4607f51 Mon Sep 17 00:00:00 2001 From: Mike Reeves Date: Tue, 9 Mar 2021 10:03:29 -0500 Subject: [PATCH] Make saved objects less hacky --- salt/kibana/bin/so-kibana-config-load | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/salt/kibana/bin/so-kibana-config-load b/salt/kibana/bin/so-kibana-config-load index 108a4f0f6..b40227031 100644 --- a/salt/kibana/bin/so-kibana-config-load +++ b/salt/kibana/bin/so-kibana-config-load @@ -14,14 +14,9 @@ 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 +## This hackery will be removed if using Elastic Auth ## # 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}') - +THECOOKIE=$(curl -c - -X GET http://localhost:5601/ | grep sid | awk '{print $7}') # Load saved objects 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