logstash-input-courier 1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/logstash/inputs/courier.rb +118 -0
  3. metadata +75 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 32555df5c71a69136733fc108edcf3beed8c6886
4
+ data.tar.gz: 8a8f556b3f7ead4f1dc8fa24293bd11d23ec2f17
5
+ SHA512:
6
+ metadata.gz: 022325acbeecbbcd62fef36c90ecc629aa13dd14e292b3b624371e01a1a92c9676f1a0054ff218e780ac3a1dfbd3c1a3f036df8a27b56b3660bd678bcdd74e77
7
+ data.tar.gz: bae5def3e95744c679a1f3757f73e22b3c2bea2fe2d70581c919a01afe563eb82927c437c338dfa3c4ff201a1fcef44880ef21539c219316fc7976c880cefd0e
@@ -0,0 +1,118 @@
1
+ # encoding: utf-8
2
+
3
+ # Copyright 2014 Jason Woods.
4
+ #
5
+ # This file is a modification of code from Logstash Forwarder.
6
+ # Copyright 2012-2013 Jordan Sissel and contributors.
7
+ #
8
+ # Licensed under the Apache License, Version 2.0 (the "License");
9
+ # you may not use this file except in compliance with the License.
10
+ # You may obtain a copy of the License at
11
+ #
12
+ # http://www.apache.org/licenses/LICENSE-2.0
13
+ #
14
+ # Unless required by applicable law or agreed to in writing, software
15
+ # distributed under the License is distributed on an "AS IS" BASIS,
16
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ # See the License for the specific language governing permissions and
18
+ # limitations under the License.
19
+
20
+ module LogStash
21
+ module Inputs
22
+ # Receive events over the Log Courier protocol
23
+ class Courier < LogStash::Inputs::Base
24
+ config_name 'courier'
25
+
26
+ default :codec, 'plain'
27
+
28
+ # The IP address to listen on
29
+ config :host, :validate => :string, :default => '0.0.0.0'
30
+
31
+ # The port to listen on
32
+ config :port, :validate => :number, :required => true
33
+
34
+ # The transport type to use
35
+ config :transport, :validate => :string, :default => 'tls'
36
+
37
+ # SSL certificate to use
38
+ config :ssl_certificate, :validate => :path
39
+
40
+ # SSL key to use
41
+ config :ssl_key, :validate => :path
42
+
43
+ # SSL key passphrase to use
44
+ config :ssl_key_passphrase, :validate => :password
45
+
46
+ # Whether or not to verify client certificates
47
+ config :ssl_verify, :validate => :boolean, :default => false
48
+
49
+ # When verifying client certificates, also trust those signed by the system's default CA bundle
50
+ config :ssl_verify_default_ca, :validate => :boolean, :default => false
51
+
52
+ # CA certificate to use when verifying client certificates
53
+ config :ssl_verify_ca, :validate => :path
54
+
55
+ # Curve secret key
56
+ config :curve_secret_key, :validate => :string
57
+
58
+ # Max packet size
59
+ config :max_packet_size, :validate => :number
60
+
61
+ # The size of the internal queue for each peer
62
+ #
63
+ # Sent payloads will be dropped when the queue is full
64
+ #
65
+ # This setting should max the max_pending_payloads Log Courier
66
+ # configuration
67
+ config :peer_recv_queue, :validate => :number
68
+
69
+ # Add additional fields to events that identity the peer
70
+ #
71
+ # This setting is only effective with the tcp and tls transports
72
+ #
73
+ # "peer" identifies the source host and port
74
+ # "peer_ssl_cn" contains the client certificate hostname for TLS peers
75
+ # using client certificates
76
+ config :add_peer_fields, :validate => :boolean
77
+
78
+ public
79
+
80
+ def register
81
+ @logger.info 'Starting courier input listener', :address => "#{@host}:#{@port}"
82
+
83
+ options = {
84
+ logger: @logger,
85
+ address: @host,
86
+ port: @port,
87
+ transport: @transport,
88
+ ssl_certificate: @ssl_certificate,
89
+ ssl_key: @ssl_key,
90
+ ssl_key_passphrase: @ssl_key_passphrase,
91
+ ssl_verify: @ssl_verify,
92
+ ssl_verify_default_ca: @ssl_verify_default_ca,
93
+ ssl_verify_ca: @ssl_verify_ca,
94
+ curve_secret_key: @curve_secret_key,
95
+ }
96
+
97
+ # Honour the defaults in the LogCourier gem
98
+ options[:max_packet_size] = @max_packet_size unless @max_packet_size.nil?
99
+ options[:peer_recv_queue] = @peer_recv_queue unless @peer_recv_queue.nil?
100
+ options[:add_peer_fields] = @add_peer_fields unless @add_peer_fields.nil?
101
+
102
+ require 'log-courier/server'
103
+ @log_courier = LogCourier::Server.new options
104
+ end
105
+
106
+ public
107
+
108
+ def run(output_queue)
109
+ @log_courier.run do |event|
110
+ event['tags'] = [event['tags']] if event.has_key?('tags') && !event['tags'].is_a?(Array)
111
+ event = LogStash::Event.new(event)
112
+ decorate event
113
+ output_queue << event
114
+ end
115
+ end
116
+ end
117
+ end
118
+ end
metadata ADDED
@@ -0,0 +1,75 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: logstash-input-courier
3
+ version: !ruby/object:Gem::Version
4
+ version: '1.6'
5
+ platform: ruby
6
+ authors:
7
+ - Jason Woods
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-05-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: logstash-core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.4'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.4'
27
+ - !ruby/object:Gem::Dependency
28
+ name: log-courier
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '='
32
+ - !ruby/object:Gem::Version
33
+ version: '1.6'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '='
39
+ - !ruby/object:Gem::Version
40
+ version: '1.6'
41
+ description: Log Courier Input Logstash Plugin
42
+ email:
43
+ - devel@jasonwoods.me.uk
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - lib/logstash/inputs/courier.rb
49
+ homepage: https://github.com/driskell/log-courier
50
+ licenses:
51
+ - Apache
52
+ metadata:
53
+ logstash_plugin: 'true'
54
+ logstash_group: input
55
+ post_install_message:
56
+ rdoc_options: []
57
+ require_paths:
58
+ - lib
59
+ required_ruby_version: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - '>='
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
64
+ required_rubygems_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ requirements: []
70
+ rubyforge_project: nowarning
71
+ rubygems_version: 2.4.2
72
+ signing_key:
73
+ specification_version: 4
74
+ summary: Receive events from Log Courier and Logstash using the Log Courier protocol
75
+ test_files: []