fluent-plugin-google-cloud 0.7.0 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile.lock +160 -0
- data/fluent-plugin-google-cloud.gemspec +1 -1
- data/lib/fluent/plugin/filter_add_insert_ids.rb +2 -2
- data/lib/fluent/plugin/out_google_cloud.rb +1 -0
- data/test/plugin/base_test.rb +31 -2
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 6d9571be109300197bc432ba7f561345addc0c2e9b477b676a05c0a56f661b46
|
4
|
+
data.tar.gz: b18d90aa70e5b25876fbe64912096225c21ad52e3bb81ad056fb0f5938d4efa4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c64ce586b924a3900ea389ab424cf5027e2e5df3703d23afde7f3076c805acc9da6c382256f722ba463e5af64f2dd8f4a311457ceb6276c76c203d2d115b3b8f
|
7
|
+
data.tar.gz: 144524c87fb2d803591d57fa0f62543a49121a4028ac2cba0efb1cf45a1f7a19a5ae094b0dc3d56651609efc36f143fe0e9aadf02700b88c93d39f0c353780f5
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,160 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
fluent-plugin-google-cloud (0.7.2)
|
5
|
+
fluentd (= 1.2.5)
|
6
|
+
google-api-client (= 0.23.9)
|
7
|
+
google-cloud-logging (= 1.5.4)
|
8
|
+
google-protobuf (= 3.6.1)
|
9
|
+
googleapis-common-protos (= 1.3.7)
|
10
|
+
googleauth (= 0.6.6)
|
11
|
+
grpc (= 1.8.3)
|
12
|
+
json (= 2.1.0)
|
13
|
+
|
14
|
+
GEM
|
15
|
+
remote: https://rubygems.org/
|
16
|
+
specs:
|
17
|
+
addressable (2.5.2)
|
18
|
+
public_suffix (>= 2.0.2, < 4.0)
|
19
|
+
ast (2.4.0)
|
20
|
+
cool.io (1.5.3)
|
21
|
+
crack (0.4.3)
|
22
|
+
safe_yaml (~> 1.0.0)
|
23
|
+
declarative (0.0.10)
|
24
|
+
declarative-option (0.1.0)
|
25
|
+
dig_rb (1.0.1)
|
26
|
+
faraday (0.15.4)
|
27
|
+
multipart-post (>= 1.2, < 3)
|
28
|
+
fluentd (1.2.5)
|
29
|
+
cool.io (>= 1.4.5, < 2.0.0)
|
30
|
+
dig_rb (~> 1.0.0)
|
31
|
+
http_parser.rb (>= 0.5.1, < 0.7.0)
|
32
|
+
msgpack (>= 0.7.0, < 2.0.0)
|
33
|
+
serverengine (>= 2.0.4, < 3.0.0)
|
34
|
+
sigdump (~> 0.2.2)
|
35
|
+
strptime (>= 0.2.2, < 1.0.0)
|
36
|
+
tzinfo (~> 1.0)
|
37
|
+
tzinfo-data (~> 1.0)
|
38
|
+
yajl-ruby (~> 1.0)
|
39
|
+
google-api-client (0.23.9)
|
40
|
+
addressable (~> 2.5, >= 2.5.1)
|
41
|
+
googleauth (>= 0.5, < 0.7.0)
|
42
|
+
httpclient (>= 2.8.1, < 3.0)
|
43
|
+
mime-types (~> 3.0)
|
44
|
+
representable (~> 3.0)
|
45
|
+
retriable (>= 2.0, < 4.0)
|
46
|
+
signet (~> 0.9)
|
47
|
+
google-cloud-core (1.2.7)
|
48
|
+
google-cloud-env (~> 1.0)
|
49
|
+
google-cloud-env (1.0.5)
|
50
|
+
faraday (~> 0.11)
|
51
|
+
google-cloud-logging (1.5.4)
|
52
|
+
google-cloud-core (~> 1.2)
|
53
|
+
google-gax (~> 1.3)
|
54
|
+
googleapis-common-protos-types (>= 1.0.2)
|
55
|
+
stackdriver-core (~> 1.3)
|
56
|
+
google-gax (1.4.0)
|
57
|
+
google-protobuf (~> 3.2)
|
58
|
+
googleapis-common-protos (>= 1.3.5, < 2.0)
|
59
|
+
googleauth (~> 0.6.2)
|
60
|
+
grpc (>= 1.7.2, < 2.0)
|
61
|
+
rly (~> 0.2.3)
|
62
|
+
google-protobuf (3.6.1)
|
63
|
+
googleapis-common-protos (1.3.7)
|
64
|
+
google-protobuf (~> 3.0)
|
65
|
+
googleapis-common-protos-types (~> 1.0)
|
66
|
+
grpc (~> 1.0)
|
67
|
+
googleapis-common-protos-types (1.0.2)
|
68
|
+
google-protobuf (~> 3.0)
|
69
|
+
googleauth (0.6.6)
|
70
|
+
faraday (~> 0.12)
|
71
|
+
jwt (>= 1.4, < 3.0)
|
72
|
+
memoist (~> 0.12)
|
73
|
+
multi_json (~> 1.11)
|
74
|
+
os (>= 0.9, < 2.0)
|
75
|
+
signet (~> 0.7)
|
76
|
+
grpc (1.8.3)
|
77
|
+
google-protobuf (~> 3.1)
|
78
|
+
googleapis-common-protos-types (~> 1.0.0)
|
79
|
+
googleauth (>= 0.5.1, < 0.7)
|
80
|
+
hashdiff (0.3.7)
|
81
|
+
http_parser.rb (0.6.0)
|
82
|
+
httpclient (2.8.3)
|
83
|
+
json (2.1.0)
|
84
|
+
jwt (2.1.0)
|
85
|
+
memoist (0.16.0)
|
86
|
+
metaclass (0.0.4)
|
87
|
+
mime-types (3.2.2)
|
88
|
+
mime-types-data (~> 3.2015)
|
89
|
+
mime-types-data (3.2018.0812)
|
90
|
+
mocha (1.7.0)
|
91
|
+
metaclass (~> 0.0.1)
|
92
|
+
msgpack (1.2.4)
|
93
|
+
multi_json (1.13.1)
|
94
|
+
multipart-post (2.0.0)
|
95
|
+
os (1.0.0)
|
96
|
+
parser (2.5.3.0)
|
97
|
+
ast (~> 2.4.0)
|
98
|
+
power_assert (1.1.3)
|
99
|
+
powerpack (0.1.2)
|
100
|
+
prometheus-client (0.7.1)
|
101
|
+
quantile (~> 0.2.0)
|
102
|
+
public_suffix (3.0.3)
|
103
|
+
quantile (0.2.1)
|
104
|
+
rainbow (2.2.2)
|
105
|
+
rake
|
106
|
+
rake (10.5.0)
|
107
|
+
representable (3.0.4)
|
108
|
+
declarative (< 0.1.0)
|
109
|
+
declarative-option (< 0.2.0)
|
110
|
+
uber (< 0.2.0)
|
111
|
+
retriable (3.1.2)
|
112
|
+
rly (0.2.3)
|
113
|
+
rubocop (0.39.0)
|
114
|
+
parser (>= 2.3.0.7, < 3.0)
|
115
|
+
powerpack (~> 0.1)
|
116
|
+
rainbow (>= 1.99.1, < 3.0)
|
117
|
+
ruby-progressbar (~> 1.7)
|
118
|
+
unicode-display_width (~> 1.0, >= 1.0.1)
|
119
|
+
ruby-progressbar (1.10.0)
|
120
|
+
safe_yaml (1.0.4)
|
121
|
+
serverengine (2.1.0)
|
122
|
+
sigdump (~> 0.2.2)
|
123
|
+
sigdump (0.2.4)
|
124
|
+
signet (0.11.0)
|
125
|
+
addressable (~> 2.3)
|
126
|
+
faraday (~> 0.9)
|
127
|
+
jwt (>= 1.5, < 3.0)
|
128
|
+
multi_json (~> 1.10)
|
129
|
+
stackdriver-core (1.3.3)
|
130
|
+
google-cloud-core (~> 1.2)
|
131
|
+
strptime (0.2.3)
|
132
|
+
test-unit (3.2.8)
|
133
|
+
power_assert
|
134
|
+
thread_safe (0.3.6)
|
135
|
+
tzinfo (1.2.5)
|
136
|
+
thread_safe (~> 0.1)
|
137
|
+
tzinfo-data (1.2018.7)
|
138
|
+
tzinfo (>= 1.0.0)
|
139
|
+
uber (0.1.0)
|
140
|
+
unicode-display_width (1.4.0)
|
141
|
+
webmock (2.3.2)
|
142
|
+
addressable (>= 2.3.6)
|
143
|
+
crack (>= 0.3.2)
|
144
|
+
hashdiff
|
145
|
+
yajl-ruby (1.4.1)
|
146
|
+
|
147
|
+
PLATFORMS
|
148
|
+
ruby
|
149
|
+
|
150
|
+
DEPENDENCIES
|
151
|
+
fluent-plugin-google-cloud!
|
152
|
+
mocha (~> 1.1)
|
153
|
+
prometheus-client (~> 0.7.1)
|
154
|
+
rake (~> 10.3)
|
155
|
+
rubocop (~> 0.39.0)
|
156
|
+
test-unit (~> 3.0)
|
157
|
+
webmock (~> 2.3.1)
|
158
|
+
|
159
|
+
BUNDLED WITH
|
160
|
+
1.16.6
|
@@ -10,7 +10,7 @@ eos
|
|
10
10
|
gem.homepage =
|
11
11
|
'https://github.com/GoogleCloudPlatform/fluent-plugin-google-cloud'
|
12
12
|
gem.license = 'Apache-2.0'
|
13
|
-
gem.version = '0.7.
|
13
|
+
gem.version = '0.7.2'
|
14
14
|
gem.authors = ['Stackdriver Agents Team']
|
15
15
|
gem.email = ['stackdriver-agents@google.com']
|
16
16
|
gem.required_ruby_version = Gem::Requirement.new('>= 2.2')
|
@@ -73,7 +73,7 @@ module Fluent
|
|
73
73
|
super
|
74
74
|
end
|
75
75
|
|
76
|
-
# rubocop:disable
|
76
|
+
# rubocop:disable Lint/UnusedMethodArgument
|
77
77
|
def filter(tag, time, record)
|
78
78
|
# Only generate and add an insertId field if the record is a hash and
|
79
79
|
# the insert ID field is not already set (or set to an empty string).
|
@@ -82,7 +82,7 @@ module Fluent
|
|
82
82
|
end
|
83
83
|
record
|
84
84
|
end
|
85
|
-
# rubocop:enable
|
85
|
+
# rubocop:enable Lint/UnusedMethodArgument
|
86
86
|
|
87
87
|
private
|
88
88
|
|
@@ -1679,6 +1679,7 @@ module Fluent
|
|
1679
1679
|
begin
|
1680
1680
|
payload_key = instance_variable_get(payload_key)
|
1681
1681
|
fields = record[payload_key]
|
1682
|
+
record.delete(payload_key) if fields.nil?
|
1682
1683
|
next unless fields.is_a?(Hash)
|
1683
1684
|
|
1684
1685
|
extracted_subfields = subfields.each_with_object({}) \
|
data/test/plugin/base_test.rb
CHANGED
@@ -387,7 +387,7 @@ module BaseTest
|
|
387
387
|
d.emit('msg' => log_entry(0))
|
388
388
|
d.run
|
389
389
|
verify_log_entries(1, COMPUTE_PARAMS, 'jsonPayload') do |entry|
|
390
|
-
|
390
|
+
assert_false entry.key?('trace'), entry
|
391
391
|
end
|
392
392
|
end
|
393
393
|
end
|
@@ -1255,6 +1255,18 @@ module BaseTest
|
|
1255
1255
|
verify_subfields_when_not_hash(DEFAULT_OPERATION_KEY)
|
1256
1256
|
end
|
1257
1257
|
|
1258
|
+
def test_log_entry_http_request_field_when_nil
|
1259
|
+
verify_subfields_when_nil(DEFAULT_HTTP_REQUEST_KEY)
|
1260
|
+
end
|
1261
|
+
|
1262
|
+
def test_log_entry_source_location_field_when_nil
|
1263
|
+
verify_subfields_when_nil(DEFAULT_SOURCE_LOCATION_KEY)
|
1264
|
+
end
|
1265
|
+
|
1266
|
+
def test_log_entry_operation_field_when_nil
|
1267
|
+
verify_subfields_when_nil(DEFAULT_OPERATION_KEY)
|
1268
|
+
end
|
1269
|
+
|
1258
1270
|
def test_http_request_from_record_with_referer_nil_or_absent
|
1259
1271
|
setup_gce_metadata_stubs
|
1260
1272
|
[
|
@@ -2140,7 +2152,24 @@ module BaseTest
|
|
2140
2152
|
verify_log_entries(1, COMPUTE_PARAMS, 'jsonPayload') do |entry|
|
2141
2153
|
field = get_fields(entry['jsonPayload'])[payload_key]
|
2142
2154
|
assert_equal 'a_string', get_string(field), entry
|
2143
|
-
|
2155
|
+
assert_false entry.key?(destination_key), entry
|
2156
|
+
end
|
2157
|
+
end
|
2158
|
+
|
2159
|
+
def verify_subfields_when_nil(payload_key)
|
2160
|
+
destination_key = log_entry_subfields_params[payload_key][0]
|
2161
|
+
@logs_sent = []
|
2162
|
+
setup_gce_metadata_stubs
|
2163
|
+
setup_logging_stubs do
|
2164
|
+
d = create_driver
|
2165
|
+
d.emit(payload_key => nil)
|
2166
|
+
d.run
|
2167
|
+
end
|
2168
|
+
|
2169
|
+
verify_log_entries(1, COMPUTE_PARAMS, 'jsonPayload') do |entry|
|
2170
|
+
fields = get_fields(entry['jsonPayload'])
|
2171
|
+
assert_false fields.key?(payload_key), entry
|
2172
|
+
assert_false entry.key?(destination_key), entry
|
2144
2173
|
end
|
2145
2174
|
end
|
2146
2175
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-google-cloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stackdriver Agents Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
@@ -219,6 +219,7 @@ extra_rdoc_files: []
|
|
219
219
|
files:
|
220
220
|
- CONTRIBUTING
|
221
221
|
- Gemfile
|
222
|
+
- Gemfile.lock
|
222
223
|
- LICENSE
|
223
224
|
- README.rdoc
|
224
225
|
- Rakefile
|
@@ -258,7 +259,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
258
259
|
version: '0'
|
259
260
|
requirements: []
|
260
261
|
rubyforge_project:
|
261
|
-
rubygems_version: 2.
|
262
|
+
rubygems_version: 2.7.8
|
262
263
|
signing_key:
|
263
264
|
specification_version: 4
|
264
265
|
summary: fluentd plugins for the Stackdriver Logging API
|