Change filebeat output test for single node test

This commit is contained in:
vcerenu
2025-05-20 10:15:24 -03:00
parent 6861e077b6
commit 3cdebd4275

View File

@@ -1,9 +1,20 @@
filebeatout=$(docker exec single-node_wazuh.manager_1 sh -c 'filebeat test output') COMMAND_TO_EXECUTE="filebeat test output"
filebeatstatus=$(echo "${filebeatout}" | grep -c OK)
if [[ filebeatstatus -eq 7 ]]; then MASTER_CONTAINERS=$(docker ps --format '{{.Names}}' | grep -E '*manager*')
echo "No errors in filebeat"
if [ -z "$CONTAINER_NAMES" ]; then
echo "No se encontraron contenedores con 'master' en su nombre."
else else
echo "Errors in filebeat" for MASTER_CONTAINERS in $MASTER_CONTAINERS; do
echo "${filebeatout}" FILEBEAT_OUTPUT=$(docker exec "$MASTER_CONTAINERS" $COMMAND_TO_EXECUTE)
exit 1 FILEBEAT_STATUS=$(echo "${FILEBEAT_OUTPUT}" | grep -c OK)
if [[ filebeatstatus -eq 7 ]]; then
echo "No errors in filebeat"
echo "${FILEBEAT_OUTPUT}"
else
echo "Errors in filebeat"
echo "${FILEBEAT_OUTPUT}"
exit 1
fi
done
fi fi