- Follow symlink if pattern_dir is one

This commit is contained in:
Jordan Sissel 2009-10-25 04:27:27 +00:00
parent 78cfbff565
commit f35a1ea88a

View file

@ -25,10 +25,14 @@ module LogStash
super(config)
if not File.exists?("#{@pattern_dir}")
if not File.exists?(@pattern_dir)
throw StandardError.new("#{@pattern_dir} does not exist")
end
if File.symlink?(@pattern_dir)
@pattern_dir = File.readlink(@pattern_dir)
end
pattern_files = []
Find.find("#{@pattern_dir}") do |file|
# ignore directories
@ -46,7 +50,6 @@ module LogStash
#puts "Compiling #{pattern} / #{grok}"
grok.compile(pattern)
#puts grok.expanded_pattern
#puts
@groks << grok
end