mirror of
https://github.com/krislamo/graylog_demo
synced 2025-01-05 13:20:36 +00:00
Fix indentation
This commit is contained in:
parent
8cca097e66
commit
e7caff95de
84
Vagrantfile
vendored
84
Vagrantfile
vendored
@ -85,53 +85,53 @@ Vagrant.configure("2") do |config|
|
|||||||
/usr/local/bin/docker-compose up -d 2> /dev/null
|
/usr/local/bin/docker-compose up -d 2> /dev/null
|
||||||
|
|
||||||
# Wait 120 seconds for Graylog to come online
|
# Wait 120 seconds for Graylog to come online
|
||||||
SECONDS=0
|
SECONDS=0
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
GRAYLOG_STATE=$(
|
GRAYLOG_STATE=$(
|
||||||
docker inspect vagrant_graylog_1 \
|
docker inspect vagrant_graylog_1 \
|
||||||
| jq --raw-output '.[] | .State.Health.Status')
|
| jq --raw-output '.[] | .State.Health.Status')
|
||||||
|
|
||||||
if [[ "$GRAYLOG_STATE" == "healthy" ]]; then
|
if [[ "$GRAYLOG_STATE" == "healthy" ]]; then
|
||||||
echo "Graylog is available."
|
echo "Graylog is available."
|
||||||
sleep 5
|
sleep 5
|
||||||
break
|
break
|
||||||
elif [[ "$GRAYLOG_STATE" != "starting" ]]; then
|
elif [[ "$GRAYLOG_STATE" != "starting" ]]; then
|
||||||
echo "Something is wrong with Graylog. Aborting."
|
echo "Something is wrong with Graylog. Aborting."
|
||||||
exit 1
|
exit 1
|
||||||
elif [[ $SECONDS -le 120 ]]; then
|
elif [[ $SECONDS -le 120 ]]; then
|
||||||
echo "Waiting for Graylog ($SECONDS/120 seconds)"
|
echo "Waiting for Graylog ($SECONDS/120 seconds)"
|
||||||
sleep 10
|
sleep 10
|
||||||
else
|
else
|
||||||
echo "Waiting on Graylog timed out. Aborting."
|
echo "Waiting on Graylog timed out. Aborting."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Check for existing GELF TCP Input
|
# Check for existing GELF TCP Input
|
||||||
INPUTSTATE=$(
|
INPUTSTATE=$(
|
||||||
curl -s -X GET \
|
curl -s -X GET \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-H "X-Requested-By: cli" \
|
-H "X-Requested-By: cli" \
|
||||||
-u admin:admin \
|
-u admin:admin \
|
||||||
"http://graylog.172.28.128.30.xip.io:8080/api/system/inputstates")
|
"http://graylog.172.28.128.30.xip.io:8080/api/system/inputstates")
|
||||||
|
|
||||||
INPUT_TYPES=$(echo $INPUTSTATE | jq --raw-output '.states | .[] | .message_input.type')
|
INPUT_TYPES=$(echo $INPUTSTATE | jq --raw-output '.states | .[] | .message_input.type')
|
||||||
|
|
||||||
for TYPE in $INPUT_TYPES; do
|
for TYPE in $INPUT_TYPES; do
|
||||||
if [[ "$TYPE" == "org.graylog2.inputs.gelf.tcp.GELFTCPInput" ]]; then
|
if [[ "$TYPE" == "org.graylog2.inputs.gelf.tcp.GELFTCPInput" ]]; then
|
||||||
echo "Found GELF TCP input in Graylog, aborting input installation."
|
echo "Found GELF TCP input in Graylog, aborting input installation."
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Install GELF TCP Input
|
# Install GELF TCP Input
|
||||||
curl -i -s -X POST \
|
curl -i -s -X POST \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-H "X-Requested-By: cli" \
|
-H "X-Requested-By: cli" \
|
||||||
-u admin:admin \
|
-u admin:admin \
|
||||||
"http://graylog.172.28.128.30.xip.io:8080/api/system/inputs" \
|
"http://graylog.172.28.128.30.xip.io:8080/api/system/inputs" \
|
||||||
-d @GELFTCPInput.json
|
-d @GELFTCPInput.json
|
||||||
|
|
||||||
SHELL
|
SHELL
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user