-
Notifications
You must be signed in to change notification settings - Fork 97
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
# 110 Globs that Return Subdirectories Error out #111
Closed
original-brownbear
wants to merge
8
commits into
logstash-plugins:master
from
original-brownbear:110
Closed
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
300264f
gitignore idea
original-brownbear 5fe6539
cleanup dirty import
original-brownbear 54a0313
#110 reproducing test
original-brownbear 20998cd
#110 ignore globbed subdirectories
original-brownbear ff85d3b
#110 use stud for temp directory
original-brownbear de2b5b6
#110 reverted trailing space cleanup
original-brownbear 9a78649
#110 log skipped folders
original-brownbear 44afc8b
#110 version + changelog
original-brownbear File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ Gemfile.lock | |
.bundle | ||
vendor | ||
*.swp | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -138,7 +138,7 @@ | |
# `SYSLOGBASE` pattern which itself is defined by other patterns. | ||
# | ||
# Another option is to define patterns _inline_ in the filter using `pattern_definitions`. | ||
# This is mostly for convenience and allows user to define a pattern which can be used just in that | ||
# This is mostly for convenience and allows user to define a pattern which can be used just in that | ||
# filter. This newly defined patterns in `pattern_definitions` will not be available outside of that particular `grok` filter. | ||
# | ||
class LogStash::Filters::Grok < LogStash::Filters::Base | ||
|
@@ -168,7 +168,7 @@ class LogStash::Filters::Grok < LogStash::Filters::Base | |
# necessarily need to define this yourself unless you are adding additional | ||
# patterns. You can point to multiple pattern directories using this setting. | ||
# Note that Grok will read all files in the directory matching the patterns_files_glob | ||
# and assume it's a pattern file (including any tilde backup files). | ||
# and assume it's a pattern file (including any tilde backup files). | ||
# [source,ruby] | ||
# patterns_dir => ["/opt/logstash/patterns", "/opt/logstash/extra_patterns"] | ||
# | ||
|
@@ -183,9 +183,9 @@ class LogStash::Filters::Grok < LogStash::Filters::Base | |
# The patterns are loaded when the pipeline is created. | ||
config :patterns_dir, :validate => :array, :default => [] | ||
|
||
# A hash of pattern-name and pattern tuples defining custom patterns to be used by | ||
# the current filter. Patterns matching existing names will override the pre-existing | ||
# definition. Think of this as inline patterns available just for this definition of | ||
# A hash of pattern-name and pattern tuples defining custom patterns to be used by | ||
# the current filter. Patterns matching existing names will override the pre-existing | ||
# definition. Think of this as inline patterns available just for this definition of | ||
# grok | ||
config :pattern_definitions, :validate => :hash, :default => {} | ||
|
||
|
@@ -237,7 +237,7 @@ class LogStash::Filters::Grok < LogStash::Filters::Base | |
config :overwrite, :validate => :array, :default => [] | ||
|
||
attr_reader :timeout_enforcer | ||
|
||
# Register default pattern paths | ||
@@patterns_path ||= Set.new | ||
@@patterns_path += [ | ||
|
@@ -298,7 +298,7 @@ def filter(event) | |
|
||
@patterns.each do |field, groks| | ||
success = match(groks, field, event) | ||
|
||
if success | ||
matched = true | ||
break if @break_on_match | ||
|
@@ -337,7 +337,7 @@ def match(groks, field, event) | |
@logger.warn("Grok regexp threw exception", :exception => e.message, :backtrace => e.backtrace, :class => e.class.name) | ||
return false | ||
end | ||
|
||
private | ||
def match_against_groks(groks, field, input, event) | ||
input = input.to_s | ||
|
@@ -351,7 +351,7 @@ def match_against_groks(groks, field, input, event) | |
break if @break_on_match | ||
end | ||
end | ||
|
||
matched | ||
end | ||
|
||
|
@@ -390,7 +390,7 @@ def patterns_files_from_paths(paths, glob) | |
|
||
Dir.glob(path).each do |file| | ||
@logger.trace("Grok loading patterns from file", :path => file) | ||
patternfiles << file | ||
patternfiles << file unless File.directory?(file) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's log when we are skipping things. Perhaps at |
||
end | ||
end | ||
patternfiles | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please disable your editor's "strip trailing whitespace" feature.