mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
Merge branch 'master' of github.com:Spredzy/logstash into Spredzy-master
Conflicts: spec/filters/grok.rb
This commit is contained in:
commit
cd7c7c197a
2 changed files with 15 additions and 1 deletions
|
@ -363,7 +363,7 @@ class LogStash::Filters::Grok < LogStash::Filters::Base
|
|||
end
|
||||
|
||||
# Special casing to skip captures that represent the entire log message.
|
||||
if fieldvalue == value and field == "@message"
|
||||
if fieldvalue == value and field == "@message" and key.nil?
|
||||
# Skip patterns that match the entire message
|
||||
@logger.debug? and @logger.debug("Skipping capture since it matches the whole line.", :field => key)
|
||||
next
|
||||
|
|
|
@ -280,4 +280,18 @@ describe LogStash::Filters::Grok do
|
|||
reject { subject["@tags"] }.include?("_grokparsefailure")
|
||||
end
|
||||
end
|
||||
|
||||
describe "captures named fields even if the whole text matches" do
|
||||
config <<-CONFIG
|
||||
filter {
|
||||
grok {
|
||||
pattern => "%{DATE_EU:stimestamp}"
|
||||
}
|
||||
}
|
||||
CONFIG
|
||||
|
||||
sample "2011/01/01" do
|
||||
insist { subject["stimestamp"] } == "2011/01/01"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue