fix(inputs.docker_log): Use correct name when matching container (#14874)
This commit is contained in:
parent
9f9ab54be7
commit
3929a42504
|
|
@ -185,11 +185,13 @@ func (d *DockerLogs) matchedContainerName(names []string) string {
|
|||
// this array is always of length 1.
|
||||
for _, name := range names {
|
||||
trimmedName := strings.TrimPrefix(name, "/")
|
||||
if !strings.Contains(trimmedName, "/") {
|
||||
match := d.containerFilter.Match(trimmedName)
|
||||
if match {
|
||||
return trimmedName
|
||||
}
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue