logstash-output-courier 1.7 → 1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/logstash/outputs/courier.rb +31 -22
  3. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7a42db984950b4a7fe3e1a74ea0808247ac209f5
4
- data.tar.gz: b58eb8f7005ce6f4d8b3c59e03e43cfcd298210b
3
+ metadata.gz: 72e48b750859112062c4c6c76636d444661f30db
4
+ data.tar.gz: b8b8460f7f0bbd726e571a7a0a5eb46fd0c2ca03
5
5
  SHA512:
6
- metadata.gz: 8d690bece81b52622ccbbd2e39f4d1241278cb9f2eea2a8d44e2ff66511f85f091ab405c8013359dd88532c0e27cb65cd87dbe4ccae8e324ce11b01f379b6030
7
- data.tar.gz: 12da4f0f77ef80d4766b9d6780710f1b94a1d817d002e086f2d65b0455fa645f0b67ad81b4e79c57075f05e38efde45aad0b5997741cc245b565b491e43da764
6
+ metadata.gz: eb453f9cec327519e8e634c9d9e7f1b526a87067d3b09ba447acb449fe7847ed1404b99fd9e3cc9a57551ee3ce897cd1a8e4d9ff4e164568aa2d36a59dc43e58
7
+ data.tar.gz: 17c26fd9167b72a12e082db8fc3430f33bc6f1713c8e7d5d8905d429bb9ea64b0a528966ed01bada31fdbd69d17cd4848c9193581f0a2950767ee58116cd80ee
@@ -17,59 +17,53 @@
17
17
  # See the License for the specific language governing permissions and
18
18
  # limitations under the License.
19
19
 
20
+ require 'logstash/version'
21
+ require 'rubygems/version'
22
+
20
23
  module LogStash
21
24
  module Outputs
22
25
  # Send events using the Log Courier protocol
23
26
  class Courier < LogStash::Outputs::Base
24
27
  config_name 'courier'
25
28
 
29
+ # Compatibility with Logstash 1.4 requires milestone
30
+ if Gem::Version.new(LOGSTASH_VERSION) < Gem::Version.new('1.5.0')
31
+ milestone 2
32
+ end
33
+
26
34
  # The list of addresses Log Courier should send to
27
- config :hosts, :validate => :array, :required => true
35
+ config :hosts, validate: :array, required: true
28
36
 
29
37
  # The port to connect to
30
- config :port, :validate => :number, :required => true
38
+ config :port, validate: :number, required: true
31
39
 
32
40
  # CA certificate for validation of the server
33
- config :ssl_ca, :validate => :path, :required => true
41
+ config :ssl_ca, validate: :path, required: true
34
42
 
35
43
  # Client SSL certificate to use
36
- config :ssl_certificate, :validate => :path
44
+ config :ssl_certificate, validate: :path
37
45
 
38
46
  # Client SSL key to use
39
- config :ssl_key, :validate => :path
47
+ config :ssl_key, validate: :path
40
48
 
41
49
  # SSL key passphrase to use
42
- config :ssl_key_passphrase, :validate => :password
50
+ config :ssl_key_passphrase, validate: :password
43
51
 
44
52
  # Maximum number of events to spool before forcing a flush
45
- config :spool_size, :validate => :number, :default => 1024
53
+ config :spool_size, validate: :number, default: 1024
46
54
 
47
55
  # Maximum time to wait for a full spool before forcing a flush
48
- config :idle_timeout, :validate => :number, :default => 5
56
+ config :idle_timeout, validate: :number, default: 5
49
57
 
50
58
  public
51
59
 
52
60
  def register
53
61
  @logger.info 'Starting courier output'
54
62
 
55
- options = {
56
- logger: @logger,
57
- addresses: @hosts,
58
- port: @port,
59
- ssl_ca: @ssl_ca,
60
- ssl_certificate: @ssl_certificate,
61
- ssl_key: @ssl_key,
62
- ssl_key_passphrase: @ssl_key_passphrase,
63
- spool_size: @spool_size,
64
- idle_timeout: @idle_timeout,
65
- }
66
-
67
63
  require 'log-courier/client'
68
64
  @client = LogCourier::Client.new(options)
69
65
  end
70
66
 
71
- public
72
-
73
67
  def receive(event)
74
68
  return unless output?(event)
75
69
  if event == LogStash::SHUTDOWN
@@ -79,6 +73,21 @@ module LogStash
79
73
  end
80
74
  @client.publish event.to_hash
81
75
  end
76
+
77
+ private
78
+
79
+ def options
80
+ result = {}
81
+
82
+ [
83
+ :logger, :addresses, :port, :ssl_ca, :ssl_certificate, :ssl_key,
84
+ :ssl_key_passphrase, :spool_size, :idle_timeout
85
+ ].each do |k|
86
+ result[k] = send(k)
87
+ end
88
+
89
+ result
90
+ end
82
91
  end
83
92
  end
84
93
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-courier
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.7'
4
+ version: '1.8'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Woods
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-03 00:00:00.000000000 Z
11
+ date: 2015-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logstash-core
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: '1.7'
33
+ version: '1.8'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: '1.7'
40
+ version: '1.8'
41
41
  description: Log Courier Output Logstash Plugin
42
42
  email:
43
43
  - devel@jasonwoods.me.uk