fluent-plugin-scalyr 0.8.4 → 0.8.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +3 -0
- data/VERSION +1 -1
- data/fluent-plugin-scalyr.gemspec +3 -0
- data/fluent.conf.sample +1 -0
- data/lib/fluent/plugin/out_scalyr.rb +26 -0
- metadata +47 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 891497d6c594d6e115191cae7b8d9d48c428770d
|
4
|
+
data.tar.gz: e1f90aac40a8ed67aaa103ec552924eddf09d54c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1be90d4ae35f8e434269493d19321e27108cf3a608d3874ad4a08d151f69706479f304688630669c8ad79b9785b628a0bf7f4764e955e7e0e7a4bdcc486684b
|
7
|
+
data.tar.gz: 29ca4a9a59d7e1047fd675a6baaaa9a37c45379e48587e586c929db78ea6b1c9323055db7f9c33792765a36cf58a02329286e3cf7ed35ea1a515a0a437d15a01
|
data/README.md
CHANGED
@@ -66,6 +66,7 @@ The following configuration options are also supported:
|
|
66
66
|
|
67
67
|
#scalyr specific options
|
68
68
|
api_write_token YOUR_SCALYR_WRITE_TOKEN
|
69
|
+
compression_type bz2
|
69
70
|
server_attributes {
|
70
71
|
"serverHost": "front-1",
|
71
72
|
"serverType": "frontend",
|
@@ -99,6 +100,8 @@ The following configuration options are also supported:
|
|
99
100
|
|
100
101
|
####Scalyr specific options
|
101
102
|
|
103
|
+
***compression_type*** - compress Scalyr traffic to reduce network traffic. Options are `bz2` and `deflate`. See [here](https://www.scalyr.com/help/scalyr-agent#compressing) for more details. This feature is optional.
|
104
|
+
|
102
105
|
***api_write_token*** - your Scalyr write logs token. See [here](http://www.scalyr.com/keys) for more details. This value **must** be specified.
|
103
106
|
|
104
107
|
***server_attributes*** - a JSON hash containing custom server attributes you want to include with each log request. This value is optional and defaults to *nil*.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.5
|
@@ -16,6 +16,9 @@ Gem::Specification.new do |gem|
|
|
16
16
|
gem.executables = Dir.glob("bin/*").map{ |f| File.basename(f) }
|
17
17
|
gem.require_paths = ['lib']
|
18
18
|
gem.add_dependency "fluentd", [">= 0.14.0", "< 2"]
|
19
|
+
gem.add_dependency "ffi", "1.9.25"
|
20
|
+
gem.add_dependency "rbzip2", "0.3.0"
|
21
|
+
gem.add_dependency "zlib"
|
19
22
|
gem.add_development_dependency "rake", "~> 0.9"
|
20
23
|
gem.add_development_dependency "test-unit", "~> 3.0"
|
21
24
|
gem.add_development_dependency "flexmock", "~> 1.2"
|
data/fluent.conf.sample
CHANGED
@@ -22,6 +22,9 @@ require 'fluent/plugin_helper/compat_parameters'
|
|
22
22
|
require 'json'
|
23
23
|
require 'net/http'
|
24
24
|
require 'net/https'
|
25
|
+
require 'rbzip2'
|
26
|
+
require 'stringio'
|
27
|
+
require 'zlib'
|
25
28
|
require 'securerandom'
|
26
29
|
require 'thread'
|
27
30
|
|
@@ -41,6 +44,8 @@ module Scalyr
|
|
41
44
|
config_param :max_request_buffer, :integer, :default => 1024*1024
|
42
45
|
config_param :force_message_encoding, :string, :default => nil
|
43
46
|
config_param :replace_invalid_utf8, :bool, :default => false
|
47
|
+
config_param :compression_type, :string, :default => nil #Valid options are bz2, deflate or None. Defaults to None.
|
48
|
+
config_param :compression_level, :integer, :default => 9 #An int containing the compression level of compression to use, from 1-9. Defaults to 9 (max)
|
44
49
|
|
45
50
|
config_section :buffer do
|
46
51
|
config_set_default :retry_max_times, 40 #try a maximum of 40 times before discarding
|
@@ -219,9 +224,30 @@ module Scalyr
|
|
219
224
|
https.verify_depth = @ssl_verify_depth
|
220
225
|
end
|
221
226
|
|
227
|
+
#use compression if enabled
|
228
|
+
encoding = nil
|
229
|
+
|
230
|
+
if @compression_type
|
231
|
+
if @compression_type == 'deflate'
|
232
|
+
encoding = 'deflate'
|
233
|
+
body = Zlib::Deflate.deflate(body, @compression_level)
|
234
|
+
elsif @compression_type == 'bz2'
|
235
|
+
encoding = 'bz2'
|
236
|
+
io = StringIO.new
|
237
|
+
bz2 = RBzip2.default_adapter::Compressor.new io
|
238
|
+
bz2.write body
|
239
|
+
bz2.close
|
240
|
+
body = io.string
|
241
|
+
end
|
242
|
+
end
|
243
|
+
|
222
244
|
post = Net::HTTP::Post.new uri.path
|
223
245
|
post.add_field( 'Content-Type', 'application/json' )
|
224
246
|
|
247
|
+
if @compression_type
|
248
|
+
post.add_field( 'Content-Encoding', encoding )
|
249
|
+
end
|
250
|
+
|
225
251
|
post.body = body
|
226
252
|
|
227
253
|
https.request( post )
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-scalyr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Imron Alston
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
@@ -30,6 +30,48 @@ dependencies:
|
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '2'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: ffi
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - '='
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: 1.9.25
|
40
|
+
type: :runtime
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - '='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 1.9.25
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rbzip2
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - '='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 0.3.0
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - '='
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: 0.3.0
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: zlib
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
type: :runtime
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
33
75
|
- !ruby/object:Gem::Dependency
|
34
76
|
name: rake
|
35
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -127,13 +169,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
169
|
version: '0'
|
128
170
|
requirements: []
|
129
171
|
rubyforge_project:
|
130
|
-
rubygems_version: 2.
|
172
|
+
rubygems_version: 2.5.2
|
131
173
|
signing_key:
|
132
174
|
specification_version: 4
|
133
175
|
summary: Scalyr plugin for fluentd
|
134
176
|
test_files:
|
135
|
-
- test/helper.rb
|
136
|
-
- test/test_config.rb
|
137
177
|
- test/test_events.rb
|
178
|
+
- test/test_config.rb
|
179
|
+
- test/helper.rb
|
138
180
|
- test/test_handle_response.rb
|
139
181
|
- test/test_ssl_verify.rb
|