mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-10 03:02:58 +01:00
Rework naming
This commit is contained in:
@@ -35,7 +35,9 @@ declare -a NEW_LIST=()
|
|||||||
if grep -q "fleet" <<< "$LOGSTASHNODES"; then
|
if grep -q "fleet" <<< "$LOGSTASHNODES"; then
|
||||||
readarray -t FLEETNODES < <(jq -r '.fleet | keys_unsorted[]' <<< "$LOGSTASHNODES")
|
readarray -t FLEETNODES < <(jq -r '.fleet | keys_unsorted[]' <<< "$LOGSTASHNODES")
|
||||||
for NODE in "${FLEETNODES[@]}"; do
|
for NODE in "${FLEETNODES[@]}"; do
|
||||||
NEW_LIST+=("http://$NODE:8443/artifacts/")
|
URL="http://$NODE:8443/artifacts/"
|
||||||
|
NAME="FleetServer_$NODE"
|
||||||
|
NEW_LIST+=("$URL=$NAME")
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -46,8 +48,11 @@ declare -A expected_urls=(
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Merge NEW_LIST into expected_urls
|
# Merge NEW_LIST into expected_urls
|
||||||
for host in "${NEW_LIST[@]}"; do
|
for entry in "${NEW_LIST[@]}"; do
|
||||||
expected_urls[$host]="FleetServer"
|
# Extract URL and Name from each entry
|
||||||
|
IFS='=' read -r URL NAME <<< "$entry"
|
||||||
|
# Add to expected_urls, automatically handling URL as key and NAME as value
|
||||||
|
expected_urls["$URL"]="$NAME"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Fetch the current hosts from the API
|
# Fetch the current hosts from the API
|
||||||
|
|||||||
Reference in New Issue
Block a user