mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Merge pull request #453 from Security-Onion-Solutions/fix/kibana_config_load
Fix/kibana config load
This commit is contained in:
@@ -1,6 +1,24 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
VERSION="7.6.1"
|
KIBANA_VERSION="7.6.1"
|
||||||
curl -X PUT "localhost:5601/api/saved_objects/config/$VERSION" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d'
|
MAX_WAIT=60
|
||||||
|
|
||||||
|
# Check to see if Kibana is available
|
||||||
|
wait_step=0
|
||||||
|
until curl -s -XGET http://localhost:5601 > /dev/null ; do
|
||||||
|
wait_step=$(( ${wait_step} + 1 ))
|
||||||
|
echo "Waiting on Kibana...Attempt #$wait_step"
|
||||||
|
if [ ${wait_step} -gt ${MAX_WAIT} ]; then
|
||||||
|
echo "ERROR: Kibana not available for more than ${MAX_WAIT} seconds."
|
||||||
|
exit 5
|
||||||
|
fi
|
||||||
|
sleep 1s;
|
||||||
|
done
|
||||||
|
|
||||||
|
# Sleep additional JIC server is not ready
|
||||||
|
sleep 30s
|
||||||
|
|
||||||
|
# Load config
|
||||||
|
curl -X PUT "localhost:5601/api/saved_objects/config/$KIBANA_VERSION" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d'
|
||||||
{ "attributes":
|
{ "attributes":
|
||||||
{
|
{
|
||||||
"defaultIndex": "2289a0c0-6970-11ea-a0cd-ffa0f6a1bc29",
|
"defaultIndex": "2289a0c0-6970-11ea-a0cd-ffa0f6a1bc29",
|
||||||
@@ -12,6 +30,5 @@ curl -X PUT "localhost:5601/api/saved_objects/config/$VERSION" -H 'kbn-xsrf: tru
|
|||||||
}
|
}
|
||||||
}'
|
}'
|
||||||
|
|
||||||
|
# Load saved objects
|
||||||
curl -X POST "localhost:5601/api/saved_objects/_import" -H "kbn-xsrf: true" --form file=@/opt/so/saltstack/salt/kibana/etc/saved_objects.ndjson
|
curl -X POST "localhost:5601/api/saved_objects/_import" -H "kbn-xsrf: true" --form file=@/opt/so/saltstack/salt/kibana/saved_objects.ndjson
|
||||||
|
|
||||||
|
|||||||
@@ -79,11 +79,11 @@ so-kibana:
|
|||||||
- port_bindings:
|
- port_bindings:
|
||||||
- 0.0.0.0:5601:5601
|
- 0.0.0.0:5601:5601
|
||||||
|
|
||||||
#o-kibana-config-load:
|
so-kibana-config-load:
|
||||||
# cmd.script:
|
cmd.script:
|
||||||
# - shell: /bin/bash
|
- shell: /bin/bash
|
||||||
# - runas: socore
|
- runas: socore
|
||||||
# - source: salt://kibana/bin/so-kibana-config-load
|
- source: salt://kibana/bin/so-kibana-config-load
|
||||||
|
|
||||||
# Keep the setting correct
|
# Keep the setting correct
|
||||||
#KibanaHappy:
|
#KibanaHappy:
|
||||||
|
|||||||
Reference in New Issue
Block a user