fluent-plugin-protobuf-http 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -0
- data/fluent-plugin-protobuf-http.gemspec +2 -2
- data/lib/fluent/plugin/in_protobuf_http.rb +21 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce7ced8f827b15e5e9520ccedf03984720014de458c653ce55a2cb3a8b2c0b4d
|
4
|
+
data.tar.gz: aec3d4403856f8d5f67f55c143d5e835b0d027dc8ef0599d952d06544a738795
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db3abc4b52dd4d9c69bc8b8f493877ce65308e2d4deca4bce4c0888d2b3e1e6d1ee39fb8c0f0ccfb43e0ef5a3367e7883feb4ecb4d104effb5ad26dd549adc3a
|
7
|
+
data.tar.gz: 36bd9d1a8877f9cd31ae66eacde63b99d89fa6d6adc29e4ed6f5240eaf713a05b1c8b8828945eac84a062fc4e1081030e00b6924eded3e55b8e287edaa0f55da
|
data/README.md
CHANGED
@@ -8,6 +8,7 @@
|
|
8
8
|
* **Incoming Message Format**: Support for binary or JSON format (`Content-Type`: `application/octet-stream` or `application/json`)
|
9
9
|
* **Outgoing Message Format**: Support for binary or JSON format
|
10
10
|
* **Message Types**: Single or Batch
|
11
|
+
* **TLS Support**: Use `<transport tls> ... </transport>` section in configuration and `https://` URL protocol prefix. See this [example](https://docs.fluentd.org/plugin-helper-overview/api-plugin-helper-server#configuration-example) for more details.
|
11
12
|
|
12
13
|
## Installation
|
13
14
|
|
@@ -44,6 +45,13 @@ $ bundle
|
|
44
45
|
* Default value: `binary`.
|
45
46
|
* **tag** (string) (required): The tag for the event.
|
46
47
|
|
48
|
+
### \<transport\> section (optional) (single)
|
49
|
+
|
50
|
+
* **protocol** (enum) (optional):
|
51
|
+
* Available values: tcp, tls
|
52
|
+
* Default value: `tcp`.
|
53
|
+
* See [example](https://docs.fluentd.org/plugin-helper-overview/api-plugin-helper-server#configuration-example).
|
54
|
+
|
47
55
|
### Example
|
48
56
|
|
49
57
|
```
|
@@ -3,12 +3,12 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |spec|
|
5
5
|
spec.name = 'fluent-plugin-protobuf-http'
|
6
|
-
spec.version = '0.
|
6
|
+
spec.version = '0.2.0'
|
7
7
|
spec.authors = ['Azeem Sajid']
|
8
8
|
spec.email = ['azeem.sajid@gmail.com']
|
9
9
|
|
10
10
|
spec.summary = 'fluentd HTTP Input Plugin for Protocol Buffers'
|
11
|
-
spec.description = 'fluentd HTTP Input Plugin for Protocol Buffers with Single and Batch Messages Support
|
11
|
+
spec.description = 'fluentd HTTP Input Plugin for Protocol Buffers with Single and Batch Messages Support'
|
12
12
|
spec.homepage = 'https://github.com/iamAzeem/fluent-plugin-protobuf-http'
|
13
13
|
spec.license = 'Apache-2.0'
|
14
14
|
|
@@ -42,6 +42,14 @@ module Fluent
|
|
42
42
|
desc 'The tag for the event.'
|
43
43
|
config_param :tag, :string
|
44
44
|
|
45
|
+
config_section :transport, required: false, multi: false, init: true, param_name: :transport_config do
|
46
|
+
config_argument :protocol, :enum, list: %i[tcp tls], default: :tcp
|
47
|
+
end
|
48
|
+
|
49
|
+
config_section :transform, required: false, multi: false, init: true, param_name: :transform_config do
|
50
|
+
config_argument :msgtype, :string
|
51
|
+
end
|
52
|
+
|
45
53
|
def initialize
|
46
54
|
super
|
47
55
|
|
@@ -136,9 +144,20 @@ module Fluent
|
|
136
144
|
compile_protos
|
137
145
|
populate_msgclass_lookup
|
138
146
|
|
139
|
-
|
147
|
+
# TLS check
|
148
|
+
proto = :tcp
|
149
|
+
tls_opts = nil
|
150
|
+
if @transport_config && @transport_config.protocol == :tls
|
151
|
+
proto = :tls
|
152
|
+
tls_opts = @transport_config.to_h
|
153
|
+
end
|
154
|
+
|
155
|
+
log.warn("#{@transform_config.to_h}")
|
156
|
+
|
157
|
+
log.info("Starting protobuf #{proto == :tcp ? 'HTTP' : 'HTTPS'} server [#{@bind}:#{@port}]...")
|
158
|
+
log.debug("TLS configuration:\n#{tls_opts}") if tls_opts
|
140
159
|
|
141
|
-
http_server_create_http_server(:protobuf_server, addr: @bind, port: @port, logger: log) do |server|
|
160
|
+
http_server_create_http_server(:protobuf_server, addr: @bind, port: @port, logger: log, proto: proto, tls_opts: tls_opts) do |server|
|
142
161
|
server.post("/#{tag}") do |req|
|
143
162
|
peeraddr = "#{req.peeraddr[2]}:#{req.peeraddr[1]}".freeze # ip:port
|
144
163
|
serialized_msg = req.body.freeze
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-protobuf-http
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Azeem Sajid
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -93,7 +93,7 @@ dependencies:
|
|
93
93
|
- !ruby/object:Gem::Version
|
94
94
|
version: 3.12.2
|
95
95
|
description: fluentd HTTP Input Plugin for Protocol Buffers with Single and Batch
|
96
|
-
Messages Support
|
96
|
+
Messages Support
|
97
97
|
email:
|
98
98
|
- azeem.sajid@gmail.com
|
99
99
|
executables: []
|