Skip to content

Commit

Permalink
#110 reproducing test
Browse files Browse the repository at this point in the history
Fixes #111
  • Loading branch information
original-brownbear committed May 9, 2017
1 parent 4527ef7 commit 7291a48
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions spec/filters/grok_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,33 @@ def pattern_path(path)
end
end

describe "patterns with file glob on directory that contains subdirectories" do
require 'tmpdir'
require 'tempfile'

let(:tmpdir) { Dir.mktmpdir(nil, "/tmp") }

before do
@file3 = Tempfile.new(['grok', '.pattern'], tmpdir)
@file3.write('WORD \b[0-1]\b')
@file3.close
Dir.mktmpdir(nil, tmpdir)
end

let(:config) do
"filter { grok { patterns_dir => \"#{tmpdir}\" patterns_files_glob => \"*\" match => { \"message\" => \"%{WORD:word}\" } } }"
end

sample("message" => '0') do
insist { subject.get("tags") } == nil
end

after do
@file3.unlink
FileUtils.remove_entry tmpdir
end
end

describe "grok with nil coerced value" do
config <<-CONFIG
filter {
Expand Down

0 comments on commit 7291a48

Please sign in to comment.