logstash-input-courier 2.7.0-java
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.
- checksums.yaml +7 -0
- data/lib/logstash/inputs/courier.rb +139 -0
- metadata +94 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 769d6be4c1bf8fc6d0b231675e3f8ba36da643ab92420e09dafe7741466576c2
|
4
|
+
data.tar.gz: b7c310340271df8b31a41c3f9166d85f6f6e3069a79eb4b47b8fd316bfe72c3f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6be5d983fc15045900104079be4207492a5bddff56de93e66d9f591253de9d1e1846eb6d41bfbcb5c90d9fde93c4e75fbbfdcc0a7ba4b7f7906f9e813d116187
|
7
|
+
data.tar.gz: 0eb1e68f4fbae642d62b33f068a2daef21653a8e36b831ee4b1e1dad926390216fb337e766fdab2aefa2522a73a48fc459d086ed18a34b33c0cd9f4dc320a542
|
@@ -0,0 +1,139 @@
|
|
1
|
+
# Copyright 2014-2021 Jason Woods.
|
2
|
+
#
|
3
|
+
# This file is a modification of code from Logstash Forwarder.
|
4
|
+
# Copyright 2012-2013 Jordan Sissel and contributors.
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
|
18
|
+
require 'logstash/version'
|
19
|
+
require 'rubygems/version'
|
20
|
+
|
21
|
+
module LogStash
|
22
|
+
module Inputs
|
23
|
+
# Receive events over the Log Courier protocol
|
24
|
+
class Courier < LogStash::Inputs::Base
|
25
|
+
config_name 'courier'
|
26
|
+
|
27
|
+
default :codec, 'plain'
|
28
|
+
|
29
|
+
# The IP address to listen on
|
30
|
+
config :host, validate: :string, default: '0.0.0.0'
|
31
|
+
|
32
|
+
# The port to listen on
|
33
|
+
config :port, validate: :number, required: true
|
34
|
+
|
35
|
+
# The transport type to use
|
36
|
+
config :transport, validate: :string, default: 'tls'
|
37
|
+
|
38
|
+
# SSL certificate to use
|
39
|
+
config :ssl_certificate, validate: :path
|
40
|
+
|
41
|
+
# SSL key to use
|
42
|
+
config :ssl_key, validate: :path
|
43
|
+
|
44
|
+
# SSL key passphrase to use
|
45
|
+
config :ssl_key_passphrase, validate: :password
|
46
|
+
|
47
|
+
# Whether or not to verify client certificates
|
48
|
+
config :ssl_verify, validate: :boolean, default: false
|
49
|
+
|
50
|
+
# When verifying client certificates, also trust those signed by the
|
51
|
+
# system's default CA bundle
|
52
|
+
config :ssl_verify_default_ca, validate: :boolean, default: false
|
53
|
+
|
54
|
+
# CA certificate to use when verifying client certificates
|
55
|
+
config :ssl_verify_ca, validate: :path
|
56
|
+
|
57
|
+
# Set minimum TLS version
|
58
|
+
config :min_tls_version, validate: :number, default: 1.2
|
59
|
+
|
60
|
+
# Max packet size
|
61
|
+
config :max_packet_size, validate: :number
|
62
|
+
|
63
|
+
# The size of the internal queue for each peer
|
64
|
+
#
|
65
|
+
# Sent payloads will be dropped when the queue is full
|
66
|
+
#
|
67
|
+
# This setting should max the max_pending_payloads Log Courier
|
68
|
+
# configuration
|
69
|
+
config :peer_recv_queue, validate: :number
|
70
|
+
|
71
|
+
# Add additional fields to events that identity the peer
|
72
|
+
#
|
73
|
+
# This setting is only effective with the tcp and tls transports
|
74
|
+
#
|
75
|
+
# "peer" identifies the source host and port
|
76
|
+
# "peer_ssl_cn" contains the client certificate hostname for TLS peers
|
77
|
+
# using client certificates
|
78
|
+
config :add_peer_fields, validate: :boolean
|
79
|
+
|
80
|
+
def register
|
81
|
+
@logger.info(
|
82
|
+
'Starting courier input listener',
|
83
|
+
address: "#{@host}:#{@port}",
|
84
|
+
)
|
85
|
+
|
86
|
+
require 'log-courier/server'
|
87
|
+
@log_courier = LogCourier::Server.new options
|
88
|
+
end
|
89
|
+
|
90
|
+
# Logstash < 2.0.0 shutdown raises LogStash::ShutdownSignal in this thread
|
91
|
+
# The exception implicitly stops the log-courier gem using an ensure block
|
92
|
+
# and is then caught by the pipeline worker - so we needn't do anything here
|
93
|
+
def run(output_queue)
|
94
|
+
@log_courier.run do |event|
|
95
|
+
event['tags'] = [event['tags']] if event.key?('tags') && !event['tags'].is_a?(Array)
|
96
|
+
event = LogStash::Event.new(event)
|
97
|
+
decorate event
|
98
|
+
output_queue << event
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
# Logstash >= 2.0.0 shutdown
|
103
|
+
def stop
|
104
|
+
@log_courier.stop
|
105
|
+
end
|
106
|
+
|
107
|
+
private
|
108
|
+
|
109
|
+
def options
|
110
|
+
result = {}
|
111
|
+
add_plugin_options result
|
112
|
+
add_override_options result
|
113
|
+
end
|
114
|
+
|
115
|
+
def add_plugin_options(result)
|
116
|
+
[
|
117
|
+
:logger, :address, :port, :transport, :ssl_certificate, :ssl_key,
|
118
|
+
:ssl_key_passphrase, :ssl_verify, :ssl_verify_default_ca,
|
119
|
+
:ssl_verify_ca, :min_tls_version,
|
120
|
+
].each do |k|
|
121
|
+
result[k] = send(k)
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
def add_override_options(result)
|
126
|
+
# Honour the defaults in the LogCourier gem
|
127
|
+
[:max_packet_size, :peer_recv_queue, :add_peer_fields].each do |k|
|
128
|
+
result[k] = send(k) unless send(k).nil?
|
129
|
+
end
|
130
|
+
result
|
131
|
+
end
|
132
|
+
|
133
|
+
def address
|
134
|
+
# TODO: Fix this naming inconsistency
|
135
|
+
@host
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
metadata
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: logstash-input-courier
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2.7.0
|
5
|
+
platform: java
|
6
|
+
authors:
|
7
|
+
- Jason Woods
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-10-20 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
15
|
+
requirements:
|
16
|
+
- - "~>"
|
17
|
+
- !ruby/object:Gem::Version
|
18
|
+
version: 2.7.0
|
19
|
+
name: log-courier
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.7.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
name: logstash-codec-plain
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '1.60'
|
47
|
+
- - "<="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '2.99'
|
50
|
+
name: logstash-core-plugin-api
|
51
|
+
type: :runtime
|
52
|
+
prerelease: false
|
53
|
+
version_requirements: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '1.60'
|
58
|
+
- - "<="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '2.99'
|
61
|
+
description: Courier Input Logstash Plugin
|
62
|
+
email:
|
63
|
+
- devel@jasonwoods.me.uk
|
64
|
+
executables: []
|
65
|
+
extensions: []
|
66
|
+
extra_rdoc_files: []
|
67
|
+
files:
|
68
|
+
- lib/logstash/inputs/courier.rb
|
69
|
+
homepage: https://github.com/driskell/logstash-input-courier
|
70
|
+
licenses:
|
71
|
+
- Apache-2.0
|
72
|
+
metadata:
|
73
|
+
logstash_plugin: 'true'
|
74
|
+
logstash_group: input
|
75
|
+
post_install_message:
|
76
|
+
rdoc_options: []
|
77
|
+
require_paths:
|
78
|
+
- lib
|
79
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
requirements: []
|
90
|
+
rubygems_version: 3.0.6
|
91
|
+
signing_key:
|
92
|
+
specification_version: 4
|
93
|
+
summary: Receive events from Log Courier and Logstash using the Courier protocol
|
94
|
+
test_files: []
|