diff --git a/CHANGELOG b/CHANGELOG index 4a22d7859..b073a1560 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,14 +4,16 @@ TODO(sissel): Document what this means, etc. - The old logstash web ui has been replaced by Kibana 3. Kibana is a far 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. - - The multiline filter is replaced by the multiline codec. - Many deprecated features have been removed. TODO(sissel): Document what these were. - 'type' is no longer a required setting on inputs. - feature: codecs. Used to implement encoding/decoding of events for input and output plugins. TODO(nickethier): Document how to use and how to hack. + - The multiline filter is replaced by the multiline codec. ## inputs - bugfix: gelf: work around gelf parser errors (#476, patch by Chris McCoy) diff --git a/lib/logstash/config/mixin.rb b/lib/logstash/config/mixin.rb index 51570c75e..37b59f71e 100644 --- a/lib/logstash/config/mixin.rb +++ b/lib/logstash/config/mixin.rb @@ -5,7 +5,6 @@ require "logstash/logging" require "logstash/util/password" require "logstash/version" require "i18n" -require "pathname" # This module is meant as a mixin to classes wishing to be configurable from # config files diff --git a/lib/logstash/monkeypatches-for-debugging.rb b/lib/logstash/monkeypatches-for-debugging.rb index 725ad3788..9a70d40b5 100644 --- a/lib/logstash/monkeypatches-for-debugging.rb +++ b/lib/logstash/monkeypatches-for-debugging.rb @@ -4,7 +4,13 @@ if $DEBUGLIST.include?("require") def require(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 alias_method :load_debug, :load diff --git a/lib/logstash/pipeline.rb b/lib/logstash/pipeline.rb index df2a20793..0edeaec63 100644 --- a/lib/logstash/pipeline.rb +++ b/lib/logstash/pipeline.rb @@ -21,7 +21,7 @@ class LogStash::Pipeline code = @config.compile # The config code is hard to represent as a log message... # So just print it. - @logger.debug? && @logger.debug("Compiled pipeline code", :code => code) + @logger.debug? && @logger.debug("Compiled pipeline code:\n#{code}") eval(code) @input_to_filter = SizedQueue.new(20) @@ -82,9 +82,10 @@ class LogStash::Pipeline def wait_inputs @input_threads.each(&:join) rescue Interrupt - # rbx doesn't do SIGINT handling very well, so we catch Interrupt here and - # signal a shutdown. For some reason the signal handler isn't invoked it - # seems? I dunno, haven't looked much into it. + # rbx does weird things during do SIGINT that I haven't debugged + # so we catch Interrupt here and signal a shutdown. For some reason the + # signal handler isn't invoked it seems? I dunno, haven't looked much into + # it. shutdown end diff --git a/lib/logstash/util.rb b/lib/logstash/util.rb index de08ec212..1012a4c14 100644 --- a/lib/logstash/util.rb +++ b/lib/logstash/util.rb @@ -1,24 +1,12 @@ require "logstash/namespace" module LogStash::Util - PR_SET_NAME = 15 - UNAME = case RbConfig::CONFIG["host_os"] when /^linux/; "linux" else; RbConfig::CONFIG["host_os"] end - module LibC - 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 - + PR_SET_NAME = 15 def self.set_thread_name(name) if RUBY_ENGINE == "jruby" # Keep java and ruby thread names in sync. @@ -27,6 +15,7 @@ module LogStash::Util Thread.current[:name] = name if UNAME == "linux" + require "logstash/util/prctl" # 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. LibC.prctl(PR_SET_NAME, name[0..16], 0, 0, 0) diff --git a/spec/test_utils.rb b/spec/test_utils.rb index 793c39530..bc5ec1289 100644 --- a/spec/test_utils.rb +++ b/spec/test_utils.rb @@ -79,9 +79,11 @@ module LogStash it "inputs" do queue = Queue.new pipeline = LogStash::Pipeline.new(config_str) - (class << pipeline; self; end).send(:define_method, :output) do |event| - queue << event - end + #(class << pipeline; self; end).send(:define_method, :output) do |event| + #p :event => event + #queue << event + #end + #p pipeline.method(:output) block.call(pipeline, queue) pipeline.shutdown end