mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
- for now space has to follow due to bug in the config parser.
This commit is contained in:
parent
0753c65331
commit
f57d8367cf
4 changed files with 14 additions and 3 deletions
|
@ -35,6 +35,9 @@ class LogStash::Agent
|
|||
public
|
||||
def initialize
|
||||
log_to(STDERR)
|
||||
@config_path = nil
|
||||
@config_string = nil
|
||||
@logfile = nil
|
||||
|
||||
# flag/config defaults
|
||||
@verbose = 0
|
||||
|
@ -238,6 +241,7 @@ class LogStash::Agent
|
|||
|
||||
configure
|
||||
|
||||
p :config_string => @config_string
|
||||
# Load the config file
|
||||
if @config_path
|
||||
# Support directory of config files.
|
||||
|
@ -256,7 +260,7 @@ class LogStash::Agent
|
|||
concatconfig << File.new(path).read
|
||||
end
|
||||
config = LogStash::Config::File.new(nil, concatconfig.join("\n"))
|
||||
elsif @config_string
|
||||
else # @config_string
|
||||
# Given a config string by the user (via the '-e' flag)
|
||||
config = LogStash::Config::File.new(nil, @config_string)
|
||||
end
|
||||
|
@ -283,6 +287,7 @@ class LogStash::Agent
|
|||
# :parameters => hash of key-value parameters from the config.
|
||||
type = plugin[:type].config_name # "input" or "filter" etc...
|
||||
klass = plugin[:plugin]
|
||||
p :plugin => plugin
|
||||
|
||||
# Create a new instance of a plugin, called like:
|
||||
# -> LogStash::Inputs::File.new( params )
|
||||
|
|
|
@ -65,7 +65,7 @@ class LogStash::Inputs::Amqp < LogStash::Inputs::Base
|
|||
@amqpsettings[:logging] = @debug
|
||||
@amqpurl = "amqp://"
|
||||
if @user or @password
|
||||
@amqpurl += "#{@user}:#{@password}@"
|
||||
@amqpurl += "#{@user}:xxxxxx@"
|
||||
end
|
||||
@amqpurl += "#{@host}:#{@port}#{@vhost}/#{@name}"
|
||||
end # def register
|
||||
|
|
|
@ -27,6 +27,12 @@ class LogStash::Runner
|
|||
require "logstash/agent"
|
||||
agent = LogStash::Agent.new
|
||||
@runners << agent
|
||||
|
||||
# TODO(sissel): There's a race condition somewhere that when two agents
|
||||
# run in the same process, if their startups coincide, there's some
|
||||
# bleeding that happens between the config parsing. I haven't figured
|
||||
# out where that is yet, but this sleep helps.
|
||||
sleep 1
|
||||
return agent.run(args)
|
||||
end,
|
||||
"web" => lambda do
|
||||
|
|
|
@ -7,5 +7,5 @@ if [ -z "$1" ] ; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
output='output { elasticsearch { embedded => true } }'
|
||||
output='output { elasticsearch { embedded => true } } '
|
||||
"$@" agent -e "$output"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue