fluent-plugin-splunk-hec 1.2.5 → 1.2.9
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 +4 -4
- data/Gemfile.lock +31 -49
- data/LICENSE +0 -1
- data/README.md +0 -1
- data/Rakefile +0 -3
- data/VERSION +1 -1
- data/fluent-plugin-splunk-hec.gemspec +1 -2
- data/lib/fluent/plugin/out_splunk.rb +31 -21
- data/lib/fluent/plugin/out_splunk_hec.rb +23 -9
- data/test/fluent/plugin/out_splunk_hec_test.rb +12 -1
- metadata +17 -31
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3fbf155dc5649294d859dbdc4bc9967681f8d4051f93e7c108bf926961f93afe
|
|
4
|
+
data.tar.gz: 1bf76e9bb39b3bbf9dc0ae87f8ca38046cbe4f30a86ae0c6c6fef4be257fbb74
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5228076cb01aa5a32c77f7d532ecb7052f57366e2dbd9d5f1e3fcae1cb7d5ca042bec12393f4c760ce05c4205068473852fdf020255b45d20679af2ee623da85
|
|
7
|
+
data.tar.gz: 82a15c018c694133cb6e5d4891413ba272087f385586582ae5b00a91b78bc455918116ee078f52f5cc26f7440852c4f2549d1b1730f2c5f3480130896f7d6fe7
|
data/Gemfile.lock
CHANGED
|
@@ -1,60 +1,59 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
fluent-plugin-splunk-hec (1.2.
|
|
4
|
+
fluent-plugin-splunk-hec (1.2.9)
|
|
5
5
|
fluentd (>= 1.4)
|
|
6
6
|
multi_json (~> 1.13)
|
|
7
7
|
net-http-persistent (~> 3.1)
|
|
8
8
|
openid_connect (~> 1.1.8)
|
|
9
|
-
prometheus-client (
|
|
9
|
+
prometheus-client (>= 2.1.0)
|
|
10
10
|
|
|
11
11
|
GEM
|
|
12
12
|
remote: https://rubygems.org/
|
|
13
13
|
specs:
|
|
14
|
-
activemodel (6.1.
|
|
15
|
-
activesupport (= 6.1.
|
|
16
|
-
activesupport (6.1.
|
|
14
|
+
activemodel (6.1.4.1)
|
|
15
|
+
activesupport (= 6.1.4.1)
|
|
16
|
+
activesupport (6.1.4.1)
|
|
17
17
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
18
18
|
i18n (>= 1.6, < 2)
|
|
19
19
|
minitest (>= 5.1)
|
|
20
20
|
tzinfo (~> 2.0)
|
|
21
21
|
zeitwerk (~> 2.3)
|
|
22
|
-
addressable (2.
|
|
22
|
+
addressable (2.8.0)
|
|
23
23
|
public_suffix (>= 2.0.2, < 5.0)
|
|
24
24
|
aes_key_wrap (1.1.0)
|
|
25
|
-
ast (2.4.2)
|
|
26
25
|
attr_required (1.0.1)
|
|
27
|
-
bindata (2.4.
|
|
28
|
-
concurrent-ruby (1.1.
|
|
29
|
-
connection_pool (2.2.
|
|
26
|
+
bindata (2.4.10)
|
|
27
|
+
concurrent-ruby (1.1.9)
|
|
28
|
+
connection_pool (2.2.5)
|
|
30
29
|
cool.io (1.7.1)
|
|
31
30
|
crack (0.4.5)
|
|
32
31
|
rexml
|
|
33
|
-
docile (1.
|
|
34
|
-
fluentd (1.
|
|
32
|
+
docile (1.4.0)
|
|
33
|
+
fluentd (1.14.2)
|
|
35
34
|
bundler
|
|
36
35
|
cool.io (>= 1.4.5, < 2.0.0)
|
|
37
|
-
http_parser.rb (>= 0.5.1, < 0.
|
|
36
|
+
http_parser.rb (>= 0.5.1, < 0.8.0)
|
|
38
37
|
msgpack (>= 1.3.1, < 2.0.0)
|
|
39
38
|
serverengine (>= 2.2.2, < 3.0.0)
|
|
40
39
|
sigdump (~> 0.2.2)
|
|
41
|
-
strptime (>= 0.2.
|
|
40
|
+
strptime (>= 0.2.4, < 1.0.0)
|
|
42
41
|
tzinfo (>= 1.0, < 3.0)
|
|
43
42
|
tzinfo-data (~> 1.0)
|
|
43
|
+
webrick (>= 1.4.2, < 1.8.0)
|
|
44
44
|
yajl-ruby (~> 1.0)
|
|
45
45
|
hashdiff (1.0.1)
|
|
46
|
-
http_parser.rb (0.
|
|
46
|
+
http_parser.rb (0.7.0)
|
|
47
47
|
httpclient (2.8.3)
|
|
48
|
-
i18n (1.8.
|
|
48
|
+
i18n (1.8.11)
|
|
49
49
|
concurrent-ruby (~> 1.0)
|
|
50
|
-
jaro_winkler (1.5.4)
|
|
51
50
|
json-jwt (1.13.0)
|
|
52
51
|
activesupport (>= 4.2)
|
|
53
52
|
aes_key_wrap
|
|
54
53
|
bindata
|
|
55
54
|
mail (2.7.1)
|
|
56
55
|
mini_mime (>= 0.1.1)
|
|
57
|
-
mini_mime (1.
|
|
56
|
+
mini_mime (1.1.2)
|
|
58
57
|
minitest (5.14.4)
|
|
59
58
|
msgpack (1.4.2)
|
|
60
59
|
multi_json (1.15.0)
|
|
@@ -70,35 +69,19 @@ GEM
|
|
|
70
69
|
validate_email
|
|
71
70
|
validate_url
|
|
72
71
|
webfinger (>= 1.0.1)
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
ast (~> 2.4.1)
|
|
76
|
-
power_assert (2.0.0)
|
|
77
|
-
powerpack (0.1.3)
|
|
78
|
-
prometheus-client (0.9.0)
|
|
79
|
-
quantile (~> 0.2.1)
|
|
72
|
+
power_assert (2.0.1)
|
|
73
|
+
prometheus-client (2.1.0)
|
|
80
74
|
public_suffix (4.0.6)
|
|
81
|
-
quantile (0.2.1)
|
|
82
75
|
rack (2.2.3)
|
|
83
|
-
rack-oauth2 (1.
|
|
76
|
+
rack-oauth2 (1.19.0)
|
|
84
77
|
activesupport
|
|
85
78
|
attr_required
|
|
86
79
|
httpclient
|
|
87
80
|
json-jwt (>= 1.11.0)
|
|
88
81
|
rack (>= 2.1.0)
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
rubocop (0.63.1)
|
|
93
|
-
jaro_winkler (~> 1.5.1)
|
|
94
|
-
parallel (~> 1.10)
|
|
95
|
-
parser (>= 2.5, != 2.5.1.1)
|
|
96
|
-
powerpack (~> 0.1)
|
|
97
|
-
rainbow (>= 2.2.2, < 4.0)
|
|
98
|
-
ruby-progressbar (~> 1.7)
|
|
99
|
-
unicode-display_width (~> 1.4.0)
|
|
100
|
-
ruby-progressbar (1.11.0)
|
|
101
|
-
serverengine (2.2.3)
|
|
82
|
+
rake (13.0.6)
|
|
83
|
+
rexml (3.2.5)
|
|
84
|
+
serverengine (2.2.4)
|
|
102
85
|
sigdump (~> 0.2.2)
|
|
103
86
|
sigdump (0.2.4)
|
|
104
87
|
simplecov (0.21.2)
|
|
@@ -106,34 +89,34 @@ GEM
|
|
|
106
89
|
simplecov-html (~> 0.11)
|
|
107
90
|
simplecov_json_formatter (~> 0.1)
|
|
108
91
|
simplecov-html (0.12.3)
|
|
109
|
-
simplecov_json_formatter (0.1.
|
|
92
|
+
simplecov_json_formatter (0.1.3)
|
|
110
93
|
strptime (0.2.5)
|
|
111
|
-
swd (1.
|
|
94
|
+
swd (1.3.0)
|
|
112
95
|
activesupport (>= 3)
|
|
113
96
|
attr_required (>= 0.0.5)
|
|
114
97
|
httpclient (>= 2.4)
|
|
115
|
-
test-unit (3.
|
|
98
|
+
test-unit (3.5.0)
|
|
116
99
|
power_assert
|
|
117
100
|
tzinfo (2.0.4)
|
|
118
101
|
concurrent-ruby (~> 1.0)
|
|
119
|
-
tzinfo-data (1.2021.
|
|
102
|
+
tzinfo-data (1.2021.5)
|
|
120
103
|
tzinfo (>= 1.0.0)
|
|
121
|
-
unicode-display_width (1.4.1)
|
|
122
104
|
validate_email (0.1.6)
|
|
123
105
|
activemodel (>= 3.0)
|
|
124
106
|
mail (>= 2.2.5)
|
|
125
107
|
validate_url (1.0.13)
|
|
126
108
|
activemodel (>= 3.0.0)
|
|
127
109
|
public_suffix
|
|
128
|
-
webfinger (1.
|
|
110
|
+
webfinger (1.2.0)
|
|
129
111
|
activesupport
|
|
130
112
|
httpclient (>= 2.4)
|
|
131
113
|
webmock (3.5.1)
|
|
132
114
|
addressable (>= 2.3.6)
|
|
133
115
|
crack (>= 0.3.2)
|
|
134
116
|
hashdiff
|
|
117
|
+
webrick (1.7.0)
|
|
135
118
|
yajl-ruby (1.4.1)
|
|
136
|
-
zeitwerk (2.
|
|
119
|
+
zeitwerk (2.5.1)
|
|
137
120
|
|
|
138
121
|
PLATFORMS
|
|
139
122
|
ruby
|
|
@@ -143,10 +126,9 @@ DEPENDENCIES
|
|
|
143
126
|
fluent-plugin-splunk-hec!
|
|
144
127
|
minitest (~> 5.0)
|
|
145
128
|
rake (>= 12.0)
|
|
146
|
-
rubocop (~> 0.63.1)
|
|
147
129
|
simplecov
|
|
148
130
|
test-unit (~> 3.0)
|
|
149
131
|
webmock (~> 3.5.0)
|
|
150
132
|
|
|
151
133
|
BUNDLED WITH
|
|
152
|
-
2.2.
|
|
134
|
+
2.2.33
|
data/LICENSE
CHANGED
|
@@ -270,7 +270,6 @@ The following components are provided under the MIT License. See project link fo
|
|
|
270
270
|
(MIT License) rake (https://github.com/ruby/rake/blob/master/MIT-LICENSE)
|
|
271
271
|
(MIT License) recursive-open-struct (https://github.com/aetherknight/recursive-open-struct/blob/master/LICENSE.txt)
|
|
272
272
|
(MIT License) rest-client (https://github.com/rest-client/rest-client/blob/master/LICENSE)
|
|
273
|
-
(MIT License) rubocop (https://github.com/rubocop-hq/rubocop/blob/master/LICENSE.txt)
|
|
274
273
|
(MIT License) ruby-progressbar (https://github.com/jfelchner/ruby-progressbar/blob/master/LICENSE.txt)
|
|
275
274
|
(MIT License) safe_yaml (https://github.com/dtao/safe_yaml/blob/master/LICENSE.txt)
|
|
276
275
|
(MIT License) sigdump (https://github.com/frsyuki/sigdump/blob/master/LICENSE)
|
data/README.md
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
[](https://circleci.com/gh/splunk/fluent-plugin-splunk-hec)
|
|
2
1
|
# fluent-plugin-splunk-hec
|
|
3
2
|
|
|
4
3
|
[Fluentd](https://fluentd.org/) output plugin to send events and metrics to [Splunk](https://www.splunk.com) in 2 modes:<br/>
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.2.
|
|
1
|
+
1.2.9
|
|
@@ -37,13 +37,12 @@ Gem::Specification.new do |spec|
|
|
|
37
37
|
spec.add_runtime_dependency 'multi_json', '~> 1.13'
|
|
38
38
|
spec.add_runtime_dependency 'net-http-persistent', '~> 3.1'
|
|
39
39
|
spec.add_runtime_dependency 'openid_connect', '~> 1.1.8'
|
|
40
|
-
spec.add_runtime_dependency 'prometheus-client', '
|
|
40
|
+
spec.add_runtime_dependency 'prometheus-client', '>= 2.1.0'
|
|
41
41
|
|
|
42
42
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
|
43
43
|
spec.add_development_dependency 'rake', '>= 12.0'
|
|
44
44
|
# required by fluent/test.rb
|
|
45
45
|
spec.add_development_dependency 'minitest', '~> 5.0'
|
|
46
|
-
spec.add_development_dependency 'rubocop', '~> 0.63.1'
|
|
47
46
|
spec.add_development_dependency 'simplecov', '~> 0.16.1'
|
|
48
47
|
spec.add_development_dependency 'test-unit', '~> 3.0'
|
|
49
48
|
spec.add_development_dependency 'webmock', '~> 3.5.0'
|
|
@@ -100,11 +100,11 @@ module Fluent::Plugin
|
|
|
100
100
|
write_to_splunk(chunk)
|
|
101
101
|
end
|
|
102
102
|
|
|
103
|
-
@metrics[:record_counter].increment(metric_labels, chunk.size_of_events)
|
|
104
|
-
@metrics[:bytes_counter].increment(metric_labels, chunk.bytesize)
|
|
105
|
-
@metrics[:write_records_histogram].observe(
|
|
106
|
-
@metrics[:write_bytes_histogram].observe(metric_labels,
|
|
107
|
-
@metrics[:write_latency_histogram].observe(metric_labels,
|
|
103
|
+
@metrics[:record_counter].increment(labels: metric_labels, by: chunk.size_of_events)
|
|
104
|
+
@metrics[:bytes_counter].increment(labels: metric_labels, by: chunk.bytesize)
|
|
105
|
+
@metrics[:write_records_histogram].observe(chunk.size_of_events, labels: metric_labels)
|
|
106
|
+
@metrics[:write_bytes_histogram].observe(chunk.bytesize, labels: metric_labels, )
|
|
107
|
+
@metrics[:write_latency_histogram].observe(t, labels: metric_labels, )
|
|
108
108
|
end
|
|
109
109
|
|
|
110
110
|
def write_to_splunk(_chunk)
|
|
@@ -153,7 +153,7 @@ module Fluent::Plugin
|
|
|
153
153
|
def process_response(response, _request_body)
|
|
154
154
|
log.trace { "[Response] POST #{@api}: #{response.inspect}" }
|
|
155
155
|
|
|
156
|
-
@metrics[:status_counter].increment(metric_labels(status: response.code.to_s))
|
|
156
|
+
@metrics[:status_counter].increment(labels: metric_labels(status: response.code.to_s))
|
|
157
157
|
|
|
158
158
|
raise_err = response.code.to_s.start_with?('5') || (!@consume_chunk_on_4xx_errors && response.code.to_s.start_with?('4'))
|
|
159
159
|
|
|
@@ -193,8 +193,8 @@ module Fluent::Plugin
|
|
|
193
193
|
v = instance_variable_get "@#{f}"
|
|
194
194
|
next unless v
|
|
195
195
|
|
|
196
|
-
if v
|
|
197
|
-
instance_variable_set "@#{f}", ->(tag, _) { tag }
|
|
196
|
+
if v.include? TAG_PLACEHOLDER
|
|
197
|
+
instance_variable_set "@#{f}", ->(tag, _) { v.gsub(TAG_PLACEHOLDER, tag) }
|
|
198
198
|
else
|
|
199
199
|
instance_variable_set "@#{f}", ->(_, _) { v }
|
|
200
200
|
end
|
|
@@ -209,7 +209,7 @@ module Fluent::Plugin
|
|
|
209
209
|
# This loop looks dump, but it is used to suppress the unused parameter configuration warning
|
|
210
210
|
# Learned from `filter_record_transformer`.
|
|
211
211
|
conf.elements.select { |element| element.name == 'fields' }.each do |element|
|
|
212
|
-
element.each_pair { |k, _v| element.
|
|
212
|
+
element.each_pair { |k, _v| element.has_key?(k) }
|
|
213
213
|
end
|
|
214
214
|
|
|
215
215
|
return unless @fields
|
|
@@ -235,28 +235,34 @@ module Fluent::Plugin
|
|
|
235
235
|
|
|
236
236
|
@metrics = {
|
|
237
237
|
record_counter: register_metric(::Prometheus::Client::Counter.new(
|
|
238
|
-
:splunk_output_write_records_count,
|
|
239
|
-
'The number of log records being sent'
|
|
238
|
+
:splunk_output_write_records_count, docstring:
|
|
239
|
+
'The number of log records being sent',
|
|
240
|
+
labels: metric_label_keys
|
|
240
241
|
)),
|
|
241
242
|
bytes_counter: register_metric(::Prometheus::Client::Counter.new(
|
|
242
|
-
:splunk_output_write_bytes_count,
|
|
243
|
-
'The number of log bytes being sent'
|
|
243
|
+
:splunk_output_write_bytes_count, docstring:
|
|
244
|
+
'The number of log bytes being sent',
|
|
245
|
+
labels: metric_label_keys
|
|
244
246
|
)),
|
|
245
247
|
status_counter: register_metric(::Prometheus::Client::Counter.new(
|
|
246
|
-
:splunk_output_write_status_count,
|
|
247
|
-
'The count of sends by response_code'
|
|
248
|
+
:splunk_output_write_status_count, docstring:
|
|
249
|
+
'The count of sends by response_code',
|
|
250
|
+
labels: metric_label_keys(status: "")
|
|
248
251
|
)),
|
|
249
252
|
write_bytes_histogram: register_metric(::Prometheus::Client::Histogram.new(
|
|
250
|
-
:splunk_output_write_payload_bytes,
|
|
251
|
-
'The size of the write payload in bytes',
|
|
253
|
+
:splunk_output_write_payload_bytes, docstring:
|
|
254
|
+
'The size of the write payload in bytes', buckets: [1024, 23_937, 47_875, 95_750, 191_500, 383_000, 766_000, 1_149_000],
|
|
255
|
+
labels: metric_label_keys
|
|
252
256
|
)),
|
|
253
257
|
write_records_histogram: register_metric(::Prometheus::Client::Histogram.new(
|
|
254
|
-
:splunk_output_write_payload_records,
|
|
255
|
-
'The number of records written per write',
|
|
258
|
+
:splunk_output_write_payload_records, docstring:
|
|
259
|
+
'The number of records written per write', buckets: [1, 10, 25, 100, 200, 300, 500, 750, 1000, 1500],
|
|
260
|
+
labels: metric_label_keys
|
|
256
261
|
)),
|
|
257
262
|
write_latency_histogram: register_metric(::Prometheus::Client::Histogram.new(
|
|
258
|
-
:splunk_output_write_latency_seconds,
|
|
259
|
-
'The latency of writes'
|
|
263
|
+
:splunk_output_write_latency_seconds, docstring:
|
|
264
|
+
'The latency of writes',
|
|
265
|
+
labels: metric_label_keys
|
|
260
266
|
))
|
|
261
267
|
}
|
|
262
268
|
end
|
|
@@ -266,6 +272,10 @@ module Fluent::Plugin
|
|
|
266
272
|
@metric_labels.merge other_labels
|
|
267
273
|
end
|
|
268
274
|
|
|
275
|
+
def metric_label_keys(other_labels = {})
|
|
276
|
+
(@metric_labels.merge other_labels).keys
|
|
277
|
+
end
|
|
278
|
+
|
|
269
279
|
# Encode as UTF-8. If 'coerce_to_utf8' is set to true in the config, any
|
|
270
280
|
# non-UTF-8 character would be replaced by the string specified by
|
|
271
281
|
# 'non_utf8_replacement_string'. If 'coerce_to_utf8' is set to false, any
|
|
@@ -31,13 +31,16 @@ module Fluent::Plugin
|
|
|
31
31
|
config_param :protocol, :enum, list: %i[http https], default: :https
|
|
32
32
|
|
|
33
33
|
desc 'The hostname/IP to HEC, or HEC load balancer.'
|
|
34
|
-
config_param :hec_host, :string
|
|
34
|
+
config_param :hec_host, :string, default: ''
|
|
35
35
|
|
|
36
36
|
desc 'The port number to HEC, or HEC load balancer.'
|
|
37
37
|
config_param :hec_port, :integer, default: 8088
|
|
38
38
|
|
|
39
|
+
desc 'Full url to connect tosplunk. Example: https://mydomain.com:8088/apps/splunk'
|
|
40
|
+
config_param :full_url, :string, default: ''
|
|
41
|
+
|
|
39
42
|
desc 'The HEC token.'
|
|
40
|
-
config_param :hec_token, :string
|
|
43
|
+
config_param :hec_token, :string, secret: true
|
|
41
44
|
|
|
42
45
|
desc 'If a connection has not been used for this number of seconds it will automatically be reset upon the next use to avoid attempting to send to a closed connection. nil means no timeout.'
|
|
43
46
|
config_param :idle_timeout, :integer, default: 5
|
|
@@ -132,7 +135,7 @@ module Fluent::Plugin
|
|
|
132
135
|
|
|
133
136
|
def configure(conf)
|
|
134
137
|
super
|
|
135
|
-
|
|
138
|
+
raise Fluent::ConfigError, 'One of `hec_host` or `full_url` is required.' if @hec_host.empty? && @full_url.empty?
|
|
136
139
|
check_metric_configs
|
|
137
140
|
pick_custom_format_method
|
|
138
141
|
end
|
|
@@ -279,9 +282,17 @@ module Fluent::Plugin
|
|
|
279
282
|
end
|
|
280
283
|
|
|
281
284
|
def construct_api
|
|
282
|
-
|
|
285
|
+
if @full_url.empty?
|
|
286
|
+
URI("#{@protocol}://#{@hec_host}:#{@hec_port}/services/collector")
|
|
287
|
+
else
|
|
288
|
+
URI("#{@full_url.delete_suffix("/")}/services/collector")
|
|
289
|
+
end
|
|
283
290
|
rescue StandardError
|
|
284
|
-
|
|
291
|
+
if @full_url.empty?
|
|
292
|
+
raise Fluent::ConfigError, "hec_host (#{@hec_host}) and/or hec_port (#{@hec_port}) are invalid."
|
|
293
|
+
else
|
|
294
|
+
raise Fluent::ConfigError, "full_url (#{@full_url}) is invalid."
|
|
295
|
+
end
|
|
285
296
|
end
|
|
286
297
|
|
|
287
298
|
def new_connection
|
|
@@ -312,10 +323,13 @@ module Fluent::Plugin
|
|
|
312
323
|
post.body = chunk.read
|
|
313
324
|
log.debug { "[Sending] Chunk: #{dump_unique_id_hex(chunk.unique_id)}(#{post.body.bytesize}B)." }
|
|
314
325
|
log.trace { "POST #{@api} body=#{post.body}" }
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
326
|
+
begin
|
|
327
|
+
t1 = Time.now
|
|
328
|
+
response = @conn.request @api, post
|
|
329
|
+
t2 = Time.now
|
|
330
|
+
rescue Net::HTTP::Persistent::Error => e
|
|
331
|
+
raise e.cause
|
|
332
|
+
end
|
|
319
333
|
|
|
320
334
|
raise_err = response.code.to_s.start_with?('5') || (!@consume_chunk_on_4xx_errors && response.code.to_s.start_with?('4'))
|
|
321
335
|
|
|
@@ -64,7 +64,7 @@ describe Fluent::Plugin::SplunkHecOutput do
|
|
|
64
64
|
|
|
65
65
|
describe 'hec_host validation' do
|
|
66
66
|
describe 'invalid host' do
|
|
67
|
-
it 'should require hec_host' do
|
|
67
|
+
it 'should require hec_host or full_url' do
|
|
68
68
|
expect { create_hec_output_driver }.must_raise Fluent::ConfigError
|
|
69
69
|
end
|
|
70
70
|
|
|
@@ -78,6 +78,17 @@ describe Fluent::Plugin::SplunkHecOutput do
|
|
|
78
78
|
end
|
|
79
79
|
end
|
|
80
80
|
|
|
81
|
+
describe 'full_url validation' do
|
|
82
|
+
describe 'invalid full_url' do
|
|
83
|
+
it { expect { create_hec_output_driver(full_url: '%bad-host%.com') }.must_raise Fluent::ConfigError }
|
|
84
|
+
end
|
|
85
|
+
describe 'good full_url' do
|
|
86
|
+
it {
|
|
87
|
+
expect(create_hec_output_driver('full_url https://splunk.com').instance.full_url).must_equal 'https://splunk.com'
|
|
88
|
+
}
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
|
|
81
92
|
it 'should send request to Splunk' do
|
|
82
93
|
req = verify_sent_events do |batch|
|
|
83
94
|
expect(batch.size).must_equal 2
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fluent-plugin-splunk-hec
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Splunk Inc.
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-
|
|
11
|
+
date: 2021-12-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: fluentd
|
|
@@ -70,16 +70,16 @@ dependencies:
|
|
|
70
70
|
name: prometheus-client
|
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
|
72
72
|
requirements:
|
|
73
|
-
- - "
|
|
73
|
+
- - ">="
|
|
74
74
|
- !ruby/object:Gem::Version
|
|
75
|
-
version:
|
|
75
|
+
version: 2.1.0
|
|
76
76
|
type: :runtime
|
|
77
77
|
prerelease: false
|
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
79
|
requirements:
|
|
80
|
-
- - "
|
|
80
|
+
- - ">="
|
|
81
81
|
- !ruby/object:Gem::Version
|
|
82
|
-
version:
|
|
82
|
+
version: 2.1.0
|
|
83
83
|
- !ruby/object:Gem::Dependency
|
|
84
84
|
name: bundler
|
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -122,20 +122,6 @@ dependencies:
|
|
|
122
122
|
- - "~>"
|
|
123
123
|
- !ruby/object:Gem::Version
|
|
124
124
|
version: '5.0'
|
|
125
|
-
- !ruby/object:Gem::Dependency
|
|
126
|
-
name: rubocop
|
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
|
128
|
-
requirements:
|
|
129
|
-
- - "~>"
|
|
130
|
-
- !ruby/object:Gem::Version
|
|
131
|
-
version: 0.63.1
|
|
132
|
-
type: :development
|
|
133
|
-
prerelease: false
|
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
135
|
-
requirements:
|
|
136
|
-
- - "~>"
|
|
137
|
-
- !ruby/object:Gem::Version
|
|
138
|
-
version: 0.63.1
|
|
139
125
|
- !ruby/object:Gem::Dependency
|
|
140
126
|
name: simplecov
|
|
141
127
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -215,7 +201,7 @@ homepage: https://github.com/splunk/fluent-plugin-splunk-hec
|
|
|
215
201
|
licenses:
|
|
216
202
|
- Apache-2.0
|
|
217
203
|
metadata: {}
|
|
218
|
-
post_install_message:
|
|
204
|
+
post_install_message:
|
|
219
205
|
rdoc_options: []
|
|
220
206
|
require_paths:
|
|
221
207
|
- lib
|
|
@@ -230,18 +216,18 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
230
216
|
- !ruby/object:Gem::Version
|
|
231
217
|
version: '0'
|
|
232
218
|
requirements: []
|
|
233
|
-
rubygems_version: 3.
|
|
234
|
-
signing_key:
|
|
219
|
+
rubygems_version: 3.1.4
|
|
220
|
+
signing_key:
|
|
235
221
|
specification_version: 4
|
|
236
222
|
summary: Fluentd plugin for Splunk HEC.
|
|
237
223
|
test_files:
|
|
238
|
-
- test/
|
|
239
|
-
- test/fluent/plugin/out_splunk_ingest_api_test.rb
|
|
240
|
-
- test/lib/webmock/http_lib_adapters/patron_adapter.rb
|
|
224
|
+
- test/test_helper.rb
|
|
241
225
|
- test/lib/webmock/http_lib_adapters/manticore_adapter.rb
|
|
242
|
-
- test/lib/webmock/http_lib_adapters/em_http_request_adapter.rb
|
|
243
|
-
- test/lib/webmock/http_lib_adapters/typhoeus_hydra_adapter.rb
|
|
244
|
-
- test/lib/webmock/http_lib_adapters/curb_adapter.rb
|
|
245
226
|
- test/lib/webmock/http_lib_adapters/http_rb_adapter.rb
|
|
227
|
+
- test/lib/webmock/http_lib_adapters/typhoeus_hydra_adapter.rb
|
|
228
|
+
- test/lib/webmock/http_lib_adapters/em_http_request_adapter.rb
|
|
246
229
|
- test/lib/webmock/http_lib_adapters/excon_adapter.rb
|
|
247
|
-
- test/
|
|
230
|
+
- test/lib/webmock/http_lib_adapters/curb_adapter.rb
|
|
231
|
+
- test/lib/webmock/http_lib_adapters/patron_adapter.rb
|
|
232
|
+
- test/fluent/plugin/out_splunk_ingest_api_test.rb
|
|
233
|
+
- test/fluent/plugin/out_splunk_hec_test.rb
|