Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
quzard committed Jan 16, 2025
1 parent 92aefd4 commit 1d183f6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugins/input/docker/logmeta/metric_container_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ func formatPath(path string) string {
if len(path) == 0 {
return path
}
// 处理开头的多个/
if strings.HasPrefix(path, "/") {
path = "/" + strings.TrimLeft(path, "/")
}
if path[len(path)-1] == '/' {
return path[0 : len(path)-1]
}
Expand Down

0 comments on commit 1d183f6

Please sign in to comment.