Fix service matching logic to use contains instead of exact match

The service discovery was using exact equality (==) instead of contains
matching, preventing services like 'sshd' from matching the 'sshd' pattern.
Restore original contains-based matching logic to find configured services.
This commit is contained in:
Christoffer Martinsson 2025-10-23 11:48:35 +02:00
parent 29d371f1a8
commit f3a81f7a0d

View File

@ -196,7 +196,7 @@ impl SystemdCollector {
// Check if this service matches our filter patterns
for pattern in service_name_filters {
if service_name == pattern {
if service_name.contains(pattern) || pattern.contains(service_name) {
debug!(
"INCLUDING service '{}' because it matches pattern '{}'",
service_name, pattern