Skip to content

Commit

Permalink
Fix Logstash 1.5.5 and 2.0.0 compatibility
Browse files Browse the repository at this point in the history
See #247
  • Loading branch information
driskell committed Nov 8, 2015
1 parent ae28982 commit 242d6cd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
21 changes: 18 additions & 3 deletions lib/logstash/inputs/courier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ class Courier < LogStash::Inputs::Base
milestone 2
end

# Disable raw_events in the Log Courier gem if we're Logstash 1.5.5+ or
# 2.0.0+. Due to changes in those versions to JrJackson, JSON outputs like
# elasticsearch can be broken by our use of raw_events (which defaults
# true). See https://github.com/driskell/log-courier/issues/247
if Gem::Version.new(LOGSTASH_VERSION) >= Gem::Version.new('1.5.5')
RAW_EVENTS = false
else
RAW_EVENTS = true
end

default :codec, 'plain'

# The IP address to listen on
Expand Down Expand Up @@ -110,17 +120,22 @@ def run(output_queue)
private

def options
result = {}
result = {
raw_events: self.RAW_EVENTS
}

add_logstash_options result
add_override_options result
end

def add_plugin_options(result)
[
:logger, :address, :port, :transport, :ssl_certificate, :ssl_key,
:ssl_key_passphrase, :ssl_verify, :ssl_verify_default_ca,
:ssl_verify_ca, :curve_secret_key
].each do |k|
result[k] = send(k)
end

add_override_options result
end

def add_override_options(result)
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.8.1
1.8.3

0 comments on commit 242d6cd

Please sign in to comment.