mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
- log the compiled code more readably
- clarify rbx issues indicating that I haven't really done any debugging to figure out where the problem is. - update changelog with todos - remove unused require - try to fix up require() debugger
This commit is contained in:
parent
d39e64f60b
commit
af538da782
6 changed files with 22 additions and 23 deletions
|
@ -4,14 +4,16 @@
|
||||||
TODO(sissel): Document what this means, etc.
|
TODO(sissel): Document what this means, etc.
|
||||||
- The old logstash web ui has been replaced by Kibana 3. Kibana is a far
|
- The old logstash web ui has been replaced by Kibana 3. Kibana is a far
|
||||||
superior search and analytics interface.
|
superior search and analytics interface.
|
||||||
|
- TODO(sissel): document new conditionals feature (LOGSTASH-661)
|
||||||
|
- TODO(sissel): document new field selection syntax (LOGSTASH-1153)
|
||||||
- ElasticSearch version 0.90.0 is included.
|
- ElasticSearch version 0.90.0 is included.
|
||||||
- The multiline filter is replaced by the multiline codec.
|
|
||||||
- Many deprecated features have been removed.
|
- Many deprecated features have been removed.
|
||||||
TODO(sissel): Document what these were.
|
TODO(sissel): Document what these were.
|
||||||
- 'type' is no longer a required setting on inputs.
|
- 'type' is no longer a required setting on inputs.
|
||||||
- feature: codecs. Used to implement encoding/decoding of events
|
- feature: codecs. Used to implement encoding/decoding of events
|
||||||
for input and output plugins.
|
for input and output plugins.
|
||||||
TODO(nickethier): Document how to use and how to hack.
|
TODO(nickethier): Document how to use and how to hack.
|
||||||
|
- The multiline filter is replaced by the multiline codec.
|
||||||
|
|
||||||
## inputs
|
## inputs
|
||||||
- bugfix: gelf: work around gelf parser errors (#476, patch by Chris McCoy)
|
- bugfix: gelf: work around gelf parser errors (#476, patch by Chris McCoy)
|
||||||
|
|
|
@ -5,7 +5,6 @@ require "logstash/logging"
|
||||||
require "logstash/util/password"
|
require "logstash/util/password"
|
||||||
require "logstash/version"
|
require "logstash/version"
|
||||||
require "i18n"
|
require "i18n"
|
||||||
require "pathname"
|
|
||||||
|
|
||||||
# This module is meant as a mixin to classes wishing to be configurable from
|
# This module is meant as a mixin to classes wishing to be configurable from
|
||||||
# config files
|
# config files
|
||||||
|
|
|
@ -4,7 +4,13 @@ if $DEBUGLIST.include?("require")
|
||||||
|
|
||||||
def require(path)
|
def require(path)
|
||||||
result = require_debug(path)
|
result = require_debug(path)
|
||||||
puts "require(\"#{path}\") => #{result} (from: #{caller[1]})"
|
origin = caller[1]
|
||||||
|
if origin =~ /rubygems\/custom_require/
|
||||||
|
origin = caller[3]
|
||||||
|
end
|
||||||
|
puts "require(\"#{path}\")" if result
|
||||||
|
#puts "require(\"#{path}\") => #{result} (from: #{origin})"
|
||||||
|
#puts caller.map { |c| " => #{c}" }.join("\n")
|
||||||
end
|
end
|
||||||
|
|
||||||
alias_method :load_debug, :load
|
alias_method :load_debug, :load
|
||||||
|
|
|
@ -21,7 +21,7 @@ class LogStash::Pipeline
|
||||||
code = @config.compile
|
code = @config.compile
|
||||||
# The config code is hard to represent as a log message...
|
# The config code is hard to represent as a log message...
|
||||||
# So just print it.
|
# So just print it.
|
||||||
@logger.debug? && @logger.debug("Compiled pipeline code", :code => code)
|
@logger.debug? && @logger.debug("Compiled pipeline code:\n#{code}")
|
||||||
eval(code)
|
eval(code)
|
||||||
|
|
||||||
@input_to_filter = SizedQueue.new(20)
|
@input_to_filter = SizedQueue.new(20)
|
||||||
|
@ -82,9 +82,10 @@ class LogStash::Pipeline
|
||||||
def wait_inputs
|
def wait_inputs
|
||||||
@input_threads.each(&:join)
|
@input_threads.each(&:join)
|
||||||
rescue Interrupt
|
rescue Interrupt
|
||||||
# rbx doesn't do SIGINT handling very well, so we catch Interrupt here and
|
# rbx does weird things during do SIGINT that I haven't debugged
|
||||||
# signal a shutdown. For some reason the signal handler isn't invoked it
|
# so we catch Interrupt here and signal a shutdown. For some reason the
|
||||||
# seems? I dunno, haven't looked much into it.
|
# signal handler isn't invoked it seems? I dunno, haven't looked much into
|
||||||
|
# it.
|
||||||
shutdown
|
shutdown
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,24 +1,12 @@
|
||||||
require "logstash/namespace"
|
require "logstash/namespace"
|
||||||
|
|
||||||
module LogStash::Util
|
module LogStash::Util
|
||||||
PR_SET_NAME = 15
|
|
||||||
|
|
||||||
UNAME = case RbConfig::CONFIG["host_os"]
|
UNAME = case RbConfig::CONFIG["host_os"]
|
||||||
when /^linux/; "linux"
|
when /^linux/; "linux"
|
||||||
else; RbConfig::CONFIG["host_os"]
|
else; RbConfig::CONFIG["host_os"]
|
||||||
end
|
end
|
||||||
|
|
||||||
module LibC
|
PR_SET_NAME = 15
|
||||||
if UNAME == "linux"
|
|
||||||
require "ffi"
|
|
||||||
extend FFI::Library
|
|
||||||
ffi_lib 'c'
|
|
||||||
|
|
||||||
# Ok so the 2nd arg isn't really a string... but whaatever
|
|
||||||
attach_function :prctl, [:int, :string, :long, :long, :long], :int
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.set_thread_name(name)
|
def self.set_thread_name(name)
|
||||||
if RUBY_ENGINE == "jruby"
|
if RUBY_ENGINE == "jruby"
|
||||||
# Keep java and ruby thread names in sync.
|
# Keep java and ruby thread names in sync.
|
||||||
|
@ -27,6 +15,7 @@ module LogStash::Util
|
||||||
Thread.current[:name] = name
|
Thread.current[:name] = name
|
||||||
|
|
||||||
if UNAME == "linux"
|
if UNAME == "linux"
|
||||||
|
require "logstash/util/prctl"
|
||||||
# prctl PR_SET_NAME allows up to 16 bytes for a process name
|
# prctl PR_SET_NAME allows up to 16 bytes for a process name
|
||||||
# since MRI 1.9, JRuby, and Rubinius use system threads for this.
|
# since MRI 1.9, JRuby, and Rubinius use system threads for this.
|
||||||
LibC.prctl(PR_SET_NAME, name[0..16], 0, 0, 0)
|
LibC.prctl(PR_SET_NAME, name[0..16], 0, 0, 0)
|
||||||
|
|
|
@ -79,9 +79,11 @@ module LogStash
|
||||||
it "inputs" do
|
it "inputs" do
|
||||||
queue = Queue.new
|
queue = Queue.new
|
||||||
pipeline = LogStash::Pipeline.new(config_str)
|
pipeline = LogStash::Pipeline.new(config_str)
|
||||||
(class << pipeline; self; end).send(:define_method, :output) do |event|
|
#(class << pipeline; self; end).send(:define_method, :output) do |event|
|
||||||
queue << event
|
#p :event => event
|
||||||
end
|
#queue << event
|
||||||
|
#end
|
||||||
|
#p pipeline.method(:output)
|
||||||
block.call(pipeline, queue)
|
block.call(pipeline, queue)
|
||||||
pipeline.shutdown
|
pipeline.shutdown
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue