diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b1b82e..075cb21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/lib/filewatch/discoverer.rb b/lib/filewatch/discoverer.rb index c101559..0b9d889 100644 --- a/lib/filewatch/discoverer.rb +++ b/lib/filewatch/discoverer.rb @@ -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}") diff --git a/logstash-input-file.gemspec b/logstash-input-file.gemspec index 24b8312..80742b3 100644 --- a/logstash-input-file.gemspec +++ b/logstash-input-file.gemspec @@ -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"