Skip to content

Commit

Permalink
fix(inputs.docker_log): Use correct name when matching container (#14874
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Kunnik authored Feb 23, 2024
1 parent 9f9ab54 commit 3929a42
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions plugins/inputs/docker_log/docker_log.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand Down

0 comments on commit 3929a42

Please sign in to comment.