Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows日志采集扫描不到path #675

Open
freeedom opened this issue Apr 19, 2024 · 0 comments
Open

windows日志采集扫描不到path #675

freeedom opened this issue Apr 19, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@freeedom
Copy link

版本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下路径

@freeedom freeedom added the bug Something isn't working label Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant