mirror of
https://github.com/AlexMacocian/ServerManagementUtils.git
synced 2026-07-15 15:19:58 +00:00
Fix filebeat script
This commit is contained in:
@@ -85,8 +85,8 @@ InstallFilebeatConfigs() {
|
||||
fi
|
||||
|
||||
# Install modules.d configurations
|
||||
LogInformation "Installing Filebeat modules from ${FILEBEAT_CONFIG_DIR}/modules"
|
||||
if [[ -d "${FILEBEAT_CONFIG_DIR}/modules" ]]; then
|
||||
LogInformation "Installing Filebeat modules from ${FILEBEAT_CONFIG_DIR}/modules.d"
|
||||
if [[ -d "${FILEBEAT_CONFIG_DIR}/modules.d" ]]; then
|
||||
while IFS= read -r -d '' module_file; do
|
||||
local filename=$(basename "$module_file")
|
||||
local target_file="${FILEBEAT_MODULES_D_DIR}/${filename}"
|
||||
@@ -99,7 +99,7 @@ InstallFilebeatConfigs() {
|
||||
LogError "Failed to install: $filename"
|
||||
((failed_count++))
|
||||
fi
|
||||
done < <(find "${FILEBEAT_CONFIG_DIR}/modules" -name "*.yml" -type f -print0)
|
||||
done < <(find "${FILEBEAT_CONFIG_DIR}/modules.d" -name "*.yml" -type f -print0)
|
||||
else
|
||||
LogWarning "modules directory not found in source"
|
||||
fi
|
||||
@@ -181,7 +181,7 @@ RemoveFilebeatConfigs() {
|
||||
rm -f "$target_file"
|
||||
((removed_count++))
|
||||
fi
|
||||
done < <(find "${FILEBEAT_CONFIG_DIR}/modules" -name "*.yml" -type f -print0 2>/dev/null)
|
||||
done < <(find "${FILEBEAT_CONFIG_DIR}/modules.d" -name "*.yml" -type f -print0 2>/dev/null)
|
||||
fi
|
||||
|
||||
if [[ $removed_count -gt 0 ]]; then
|
||||
|
||||
Reference in New Issue
Block a user