From f3a81f7a0d314e13f72e6e3a15d8f102d318fea6 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Thu, 23 Oct 2025 11:48:35 +0200 Subject: [PATCH] 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. --- agent/src/collectors/systemd.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/src/collectors/systemd.rs b/agent/src/collectors/systemd.rs index 88b47b3..e89c1f3 100644 --- a/agent/src/collectors/systemd.rs +++ b/agent/src/collectors/systemd.rs @@ -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