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

Handle wildcards in windows files paths in the in_tail plugin. #1541

Closed

Conversation

iantalarico
Copy link
Contributor

Currently tail plugins on windows will work if a specific file is targeted:

<source>
  type tail
  format none
  path C:\SomeDir\Logs\the.logs
  tag custom-logs
</source>

However with wildcards the log files will not be picked up:

<source>
  type tail
  format none
  path C:\SomeDir\Logs\**\*'
  tag custom-logs
</source>

This is due to Dir.glob not handing ''s properly. The '' must be converted to '/'. FIle.* methods will take either a '' or '/'.

Users could define paths with '/'s but this is not idiomatic for windows users.

Currently tail plugins on windows will work if a specific file is targeted:
<source>
  type tail
  format none
  path C:\SomeDir\Logs\the.logs
  tag custom-logs
</source>

However with wildcards the log files will not be picked up:
<source>
  type tail
  format none
  path C:\SomeDir\Logs\**\*'
  tag custom-logs
</source>

This is due to Dir.glob not handing '\'.  The '\' must be converted to '/'.  FIle.* methods will take either a '\' or '/' so just changing all '\' from the start is the easist.

Users could define paths with '/'s but this is not idomatic for windows users.
@repeatedly
Copy link
Member

Your approach is incomplete.
See previous discussion: #754

@iantalarico
Copy link
Contributor Author

Ops I missed that issue, sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants