Skip to content

discoverer.rb: Exclude patterns match filename #252

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

Merged
merged 2 commits into from
Jan 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 4.1.12
- Fix regression in `exclude` handling. Patterns are matched against the filename, not full path.
[Issue #237](https://github.com/logstash-plugins/logstash-input-file/issues/237)

## 4.1.11
- Fixed link to FAQ [#247](https://github.com/logstash-plugins/logstash-input-file/pull/247)

Expand Down
2 changes: 1 addition & 1 deletion lib/filewatch/discoverer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def discover

def can_exclude?(watched_file, new_discovery)
@exclude.each do |pattern|
if watched_file.pathname.fnmatch?(pattern)
if watched_file.pathname.basename.fnmatch?(pattern)
if new_discovery
logger.trace("Discoverer can_exclude?: #{watched_file.path}: skipping " +
"because it matches exclude #{pattern}")
Expand Down
2 changes: 1 addition & 1 deletion logstash-input-file.gemspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Gem::Specification.new do |s|

s.name = 'logstash-input-file'
s.version = '4.1.11'
s.version = '4.1.12'
s.licenses = ['Apache-2.0']
s.summary = "Streams events from files"
s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
Expand Down