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

Curly braces in file source exclude patterns not supported #5936

Open
pablosichert opened this issue Jan 8, 2021 · 0 comments
Open

Curly braces in file source exclude patterns not supported #5936

pablosichert opened this issue Jan 8, 2021 · 0 comments
Labels
source: file Anything `file` source related type: bug A code related bug.

Comments

@pablosichert
Copy link
Contributor

Vector Version

vector 0.12.0

Vector Configuration File

[sources.files]
  type = "file"
  include = ["*.log"]
  exclude = ["{foo,bar}.log"]

[sinks.console]
  inputs = ["files"]
  type = "console"
  encoding.codec = "text"

Expected Behavior

The vector file source ignores foo.log and bar.log.

Actual Behavior

Files foo.log and bar.log are ingested.

Additional Context

The exclude_patterns currently relies on glob::Pattern which does not support curly-brace patterns. The globwalk crate used for include_patterns doesn't provide any means to just pattern match without walking the FS.

Proposed approach:

GlobWalker internally uses ignore::Override, and supports adding patterns to the ignore::overrides::OverrideBuilder. The OverrideBuilder supports negating matches by prepending the glob with a !.

References

@pablosichert pablosichert added type: bug A code related bug. source: file Anything `file` source related labels Jan 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
source: file Anything `file` source related type: bug A code related bug.
Projects
None yet
Development

No branches or pull requests

1 participant