- fix pattern_dir support (again)

- some defaults
This commit is contained in:
Pete Fritchman 2009-10-20 20:50:02 +00:00
parent 7e7dc90cfa
commit b9f811eea5
2 changed files with 5 additions and 5 deletions

View file

@ -13,8 +13,8 @@ module LogStash; module Config
super(file)
obj = YAML::load(File.open(file).read())
@logstash_dir = obj["logstash_dir"]
@pattern_dir = obj["pattern_dir"]
@logstash_dir = obj["logstash_dir"] || "/var/logstash"
@pattern_dir = obj["pattern_dir"] || "/opt/logstash/patterns"
@logs = LogStash::Logs.new
obj["log-types"].each do |log_type, data|

View file

@ -25,12 +25,12 @@ module LogStash
super(config)
if not File.exists?("#{@pattern_dir}/patterns")
throw StandardError.new("#{@pattern_dir}/patterns/ does not exist")
if not File.exists?("#{@pattern_dir}")
throw StandardError.new("#{@pattern_dir} does not exist")
end
pattern_files = []
Find.find("#{@pattern_dir}/patterns") do |file|
Find.find("#{@pattern_dir}") do |file|
# ignore directories
next if File.directory?(file)
# ignore dotfiles