[Onboarding] Auto-detect. Always suggest System integration. (#189370)

Closes https://github.com/elastic/kibana/issues/189355

Removes pattern-matching for System integration and always suggests it
to be installed. Also renames it to "System Logs And Metrics".
This commit is contained in:
Mykola Harmash 2024-07-30 10:25:22 +02:00 committed by GitHub
parent f391ed6bcf
commit 4c49ccf480
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -314,13 +314,18 @@ read_open_log_file_list() {
# Filtering by the exclude patterns
while IFS= read -r line; do
if ! grep -qE "$(IFS="|"; echo "${exclude_patterns[*]}")" <<< "$line"; then
unknown_log_file_path_list_string+="$line\n"
fi
if ! grep -qE "$(IFS="|"; echo "${exclude_patterns[*]}")" <<< "$line"; then
unknown_log_file_path_list_string+="$line\n"
fi
done <<< "$list"
}
detect_known_integrations() {
# Always suggesting to install System integartion.
# Even when there is no system logs on the host,
# System integration will still be able to to collect metrics.
known_integrations_list_string+="system"$'\n'
local nginx_patterns=(
"/var/log/nginx/access.log*"
"/var/log/nginx/error.log*"
@ -353,22 +358,6 @@ detect_known_integrations() {
elif compgen -G "/var/lib/docker/containers/*/*-json.log" > /dev/null; then
known_integrations_list_string+="docker"$'\n'
fi
local system_patterns=(
"/var/log/messages*"
"/var/log/syslog*"
"/var/log/system*"
"/var/log/auth.log*"
"/var/log/secure*"
"/var/log/system.log*"
)
for pattern in "${system_patterns[@]}"; do
if compgen -G "$pattern" > /dev/null; then
known_integrations_list_string+="system"$'\n'
break
fi
done
}
known_integration_title() {
@ -384,7 +373,7 @@ known_integration_title() {
echo "Docker Container Logs"
;;
"system")
echo "System Logs"
echo "System Logs And Metrics"
;;
*)
echo "Unknown"
@ -394,6 +383,10 @@ known_integration_title() {
build_unknown_log_file_patterns() {
while IFS= read -r log_file_path; do
if [ -z "$log_file_path" ]; then
continue
fi
unknown_log_file_pattern_list_string+="$(dirname "$log_file_path")/*.log\n"
done <<< "$(echo -e $unknown_log_file_path_list_string)"