loggie-io/loggie

windows日志采集扫描不到path

Opened this issue · 0 comments

版本release-v1.5
pipelines 如下

pipelines:

  • sources:
    • watcher:
      readFromTail: false
      charset: "utf-8"
      paths:
      • "C:\tmp\*.log"
        cleanFiles: {}
        name: "windows-path"
        type: "file"
        sink:
        type: dev
        printEvents: true

控制台中一直没有打印出来日志,在pkg/util/file.go GlobWithRecursive函数返回处加了日志打印匹配的路径,显示空列表

查看函数中使用的xglob.SplitPattern(pattern),函数内按照/路径符来找到baseDir和pattern,显然是有问题的,这里需要先对pattern执行pattern = filepath.ToSlash(pattern),再传入xglob.SplitPattern,实测修改后能扫描到windows下路径