mirror of
https://github.com/AlexMacocian/ServerManagementUtils.git
synced 2026-07-15 15:19:58 +00:00
Fix pipelines.yml paths
This commit is contained in:
@@ -68,6 +68,36 @@ UpdateOutputConfig() {
|
||||
fi
|
||||
}
|
||||
|
||||
UpdatePipelinesConfig() {
|
||||
local pipelines_file="${LOGSTASH_CONFIG_DIR}/pipelines.yml"
|
||||
local temp_file=$(mktemp)
|
||||
|
||||
if [[ ! -f "$pipelines_file" ]]; then
|
||||
LogError "Pipelines config file not found: $pipelines_file"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
LogInformation "Updating path.config in pipelines.yml for $OS_TYPE"
|
||||
|
||||
# Update path.config based on OS
|
||||
if [[ "$OS_TYPE" == "macos" ]]; then
|
||||
sed 's|path\.config: "/etc/logstash/conf\.d/\*\.conf"|path.config: "/usr/local/etc/logstash/conf.d/*.conf"|' \
|
||||
"$pipelines_file" > "$temp_file"
|
||||
else
|
||||
# Linux - keep as is
|
||||
cp "$pipelines_file" "$temp_file"
|
||||
fi
|
||||
|
||||
if grep -q "path.config:" "$temp_file"; then
|
||||
mv "$temp_file" "$pipelines_file"
|
||||
LogInformation "Updated pipelines.yml path.config for $OS_TYPE"
|
||||
else
|
||||
rm -f "$temp_file"
|
||||
LogError "Failed to update pipelines.yml"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
InstallLogstashConfigs() {
|
||||
local installed_count=0
|
||||
local failed_count=0
|
||||
@@ -272,6 +302,7 @@ Main() {
|
||||
CheckRoot
|
||||
CheckLogstashInstalled
|
||||
UpdateOutputConfig "$user" "$password" "$host"
|
||||
UpdatePipelinesConfig
|
||||
InstallLogstashConfigs
|
||||
ValidateLogstashConfig
|
||||
LogInformation "Logstash setup completed successfully!"
|
||||
|
||||
Reference in New Issue
Block a user