fix(inputs.docker_log): Use correct name when matching container (#14874)

This commit is contained in:
Kunnik 2024-02-23 15:41:41 +01:00 committed by GitHub
parent 9f9ab54be7
commit 3929a42504
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 3 deletions

View File

@ -185,9 +185,11 @@ func (d *DockerLogs) matchedContainerName(names []string) string {
// this array is always of length 1.
for _, name := range names {
trimmedName := strings.TrimPrefix(name, "/")
match := d.containerFilter.Match(trimmedName)
if match {
return trimmedName
if !strings.Contains(trimmedName, "/") {
match := d.containerFilter.Match(trimmedName)
if match {
return trimmedName
}
}
}
return ""