mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
elastic_fleet_integration_policy_package_version
This commit is contained in:
@@ -171,13 +171,13 @@ elastic_fleet_integration_policy_package_version() {
|
|||||||
AGENT_POLICY=$1
|
AGENT_POLICY=$1
|
||||||
INTEGRATION=$2
|
INTEGRATION=$2
|
||||||
|
|
||||||
if output=$(curl -s -K /opt/so/conf/elasticsearch/curl.config -L -X GET "localhost:5601/api/fleet/agent_policies/$AGENT_POLICY" --fail); then
|
if output=$(fleet_api "localhost:5601/api/fleet/agent_policies/$AGENT_POLICY"); then
|
||||||
if version=$(jq -e -r --arg INTEGRATION "$INTEGRATION" '.item.package_policies[] | select(.name==$INTEGRATION)| .package.version' <<< $output); then
|
if version=$(jq -e -r --arg INTEGRATION "$INTEGRATION" '.item.package_policies[] | select(.name==$INTEGRATION)| .package.version' <<< "$output"); then
|
||||||
echo "$version"
|
echo "$version"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "Error: Failed to retrieve agent policy $AGENT_POLICY"
|
echo "Error: Failed to retrieve agent policy $AGENT_POLICY"
|
||||||
exit 1
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user