fluent-plugin-splunk-hec 1.2.6 → 1.2.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +27 -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 -22
- data/lib/fluent/plugin/out_splunk_hec.rb +27 -9
- data/lib/fluent/plugin/out_splunk_ingest_api.rb +5 -1
- data/test/fluent/plugin/out_splunk_hec_test.rb +12 -1
- metadata +14 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc792fc7c40630f15ecb739d4b5fb02d8b0eb82bae0cea4d83f2a3bc2033f86a
|
4
|
+
data.tar.gz: 7db6c9fbcc52941f5196c69dfb472b01126983003efa1924b87514ab73ceaab3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f1370fc994cd6ff1d41e1c8b6714a81159f899fc60f133e7842963f7a2d24b192d7c385b8f4dc596c4b6975e48de40dc3025fda16c9aa7913871fbb30ba3b0d
|
7
|
+
data.tar.gz: be09848d438d90c78c45981efd44e1c57d92842ea3249c9099abecb2efdff84bc012766e45cd8807f4a047b73ee42639d277262f277a9ec3c4b4a75eeef9c4e7
|
data/Gemfile.lock
CHANGED
@@ -1,28 +1,26 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fluent-plugin-splunk-hec (1.2.
|
4
|
+
fluent-plugin-splunk-hec (1.2.10)
|
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 (
|
15
|
-
activesupport (=
|
16
|
-
activesupport (
|
14
|
+
activemodel (7.0.1)
|
15
|
+
activesupport (= 7.0.1)
|
16
|
+
activesupport (7.0.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
|
-
|
22
|
-
addressable (2.7.0)
|
21
|
+
addressable (2.8.0)
|
23
22
|
public_suffix (>= 2.0.2, < 5.0)
|
24
23
|
aes_key_wrap (1.1.0)
|
25
|
-
ast (2.4.2)
|
26
24
|
attr_required (1.0.1)
|
27
25
|
bindata (2.4.10)
|
28
26
|
concurrent-ruby (1.1.9)
|
@@ -30,34 +28,33 @@ GEM
|
|
30
28
|
cool.io (1.7.1)
|
31
29
|
crack (0.4.5)
|
32
30
|
rexml
|
33
|
-
docile (1.
|
34
|
-
fluentd (1.
|
31
|
+
docile (1.4.0)
|
32
|
+
fluentd (1.14.4)
|
35
33
|
bundler
|
36
34
|
cool.io (>= 1.4.5, < 2.0.0)
|
37
|
-
http_parser.rb (>= 0.5.1, < 0.
|
35
|
+
http_parser.rb (>= 0.5.1, < 0.9.0)
|
38
36
|
msgpack (>= 1.3.1, < 2.0.0)
|
39
37
|
serverengine (>= 2.2.2, < 3.0.0)
|
40
38
|
sigdump (~> 0.2.2)
|
41
|
-
strptime (>= 0.2.
|
39
|
+
strptime (>= 0.2.4, < 1.0.0)
|
42
40
|
tzinfo (>= 1.0, < 3.0)
|
43
41
|
tzinfo-data (~> 1.0)
|
44
42
|
webrick (>= 1.4.2, < 1.8.0)
|
45
43
|
yajl-ruby (~> 1.0)
|
46
44
|
hashdiff (1.0.1)
|
47
|
-
http_parser.rb (0.
|
45
|
+
http_parser.rb (0.8.0)
|
48
46
|
httpclient (2.8.3)
|
49
|
-
i18n (1.
|
47
|
+
i18n (1.9.1)
|
50
48
|
concurrent-ruby (~> 1.0)
|
51
|
-
jaro_winkler (1.5.4)
|
52
49
|
json-jwt (1.13.0)
|
53
50
|
activesupport (>= 4.2)
|
54
51
|
aes_key_wrap
|
55
52
|
bindata
|
56
53
|
mail (2.7.1)
|
57
54
|
mini_mime (>= 0.1.1)
|
58
|
-
mini_mime (1.1.
|
59
|
-
minitest (5.
|
60
|
-
msgpack (1.4.
|
55
|
+
mini_mime (1.1.2)
|
56
|
+
minitest (5.15.0)
|
57
|
+
msgpack (1.4.4)
|
61
58
|
multi_json (1.15.0)
|
62
59
|
net-http-persistent (3.1.0)
|
63
60
|
connection_pool (~> 2.2)
|
@@ -71,35 +68,19 @@ GEM
|
|
71
68
|
validate_email
|
72
69
|
validate_url
|
73
70
|
webfinger (>= 1.0.1)
|
74
|
-
|
75
|
-
|
76
|
-
ast (~> 2.4.1)
|
77
|
-
power_assert (2.0.0)
|
78
|
-
powerpack (0.1.3)
|
79
|
-
prometheus-client (0.9.0)
|
80
|
-
quantile (~> 0.2.1)
|
71
|
+
power_assert (2.0.1)
|
72
|
+
prometheus-client (2.1.0)
|
81
73
|
public_suffix (4.0.6)
|
82
|
-
quantile (0.2.1)
|
83
74
|
rack (2.2.3)
|
84
|
-
rack-oauth2 (1.
|
75
|
+
rack-oauth2 (1.19.0)
|
85
76
|
activesupport
|
86
77
|
attr_required
|
87
78
|
httpclient
|
88
79
|
json-jwt (>= 1.11.0)
|
89
80
|
rack (>= 2.1.0)
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
rubocop (0.63.1)
|
94
|
-
jaro_winkler (~> 1.5.1)
|
95
|
-
parallel (~> 1.10)
|
96
|
-
parser (>= 2.5, != 2.5.1.1)
|
97
|
-
powerpack (~> 0.1)
|
98
|
-
rainbow (>= 2.2.2, < 4.0)
|
99
|
-
ruby-progressbar (~> 1.7)
|
100
|
-
unicode-display_width (~> 1.4.0)
|
101
|
-
ruby-progressbar (1.11.0)
|
102
|
-
serverengine (2.2.4)
|
81
|
+
rake (13.0.6)
|
82
|
+
rexml (3.2.5)
|
83
|
+
serverengine (2.2.5)
|
103
84
|
sigdump (~> 0.2.2)
|
104
85
|
sigdump (0.2.4)
|
105
86
|
simplecov (0.21.2)
|
@@ -107,26 +88,25 @@ GEM
|
|
107
88
|
simplecov-html (~> 0.11)
|
108
89
|
simplecov_json_formatter (~> 0.1)
|
109
90
|
simplecov-html (0.12.3)
|
110
|
-
simplecov_json_formatter (0.1.
|
91
|
+
simplecov_json_formatter (0.1.3)
|
111
92
|
strptime (0.2.5)
|
112
|
-
swd (1.
|
93
|
+
swd (1.3.0)
|
113
94
|
activesupport (>= 3)
|
114
95
|
attr_required (>= 0.0.5)
|
115
96
|
httpclient (>= 2.4)
|
116
|
-
test-unit (3.
|
97
|
+
test-unit (3.5.3)
|
117
98
|
power_assert
|
118
99
|
tzinfo (2.0.4)
|
119
100
|
concurrent-ruby (~> 1.0)
|
120
|
-
tzinfo-data (1.2021.
|
101
|
+
tzinfo-data (1.2021.5)
|
121
102
|
tzinfo (>= 1.0.0)
|
122
|
-
unicode-display_width (1.4.1)
|
123
103
|
validate_email (0.1.6)
|
124
104
|
activemodel (>= 3.0)
|
125
105
|
mail (>= 2.2.5)
|
126
106
|
validate_url (1.0.13)
|
127
107
|
activemodel (>= 3.0.0)
|
128
108
|
public_suffix
|
129
|
-
webfinger (1.
|
109
|
+
webfinger (1.2.0)
|
130
110
|
activesupport
|
131
111
|
httpclient (>= 2.4)
|
132
112
|
webmock (3.5.1)
|
@@ -135,7 +115,6 @@ GEM
|
|
135
115
|
hashdiff
|
136
116
|
webrick (1.7.0)
|
137
117
|
yajl-ruby (1.4.1)
|
138
|
-
zeitwerk (2.4.2)
|
139
118
|
|
140
119
|
PLATFORMS
|
141
120
|
ruby
|
@@ -145,10 +124,9 @@ DEPENDENCIES
|
|
145
124
|
fluent-plugin-splunk-hec!
|
146
125
|
minitest (~> 5.0)
|
147
126
|
rake (>= 12.0)
|
148
|
-
rubocop (~> 0.63.1)
|
149
127
|
simplecov
|
150
128
|
test-unit (~> 3.0)
|
151
129
|
webmock (~> 3.5.0)
|
152
130
|
|
153
131
|
BUNDLED WITH
|
154
|
-
2.
|
132
|
+
2.3.6
|
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
|
-
[![CircleCI](https://circleci.com/gh/git-lfs/git-lfs.svg?style=shield&circle-token=856152c2b02bfd236f54d21e1f581f3e4ebf47ad)](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.10
|
@@ -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'
|
@@ -1,13 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'fluent/output'
|
4
3
|
require 'fluent/plugin/output'
|
5
4
|
require 'fluent/plugin/formatter'
|
6
5
|
require 'prometheus/client'
|
7
6
|
require 'benchmark'
|
8
7
|
|
9
8
|
module Fluent::Plugin
|
10
|
-
class SplunkOutput < Fluent::
|
9
|
+
class SplunkOutput < Fluent::Plugin::Output
|
11
10
|
helpers :formatter
|
12
11
|
|
13
12
|
autoload :VERSION, 'fluent/plugin/out_splunk/version'
|
@@ -100,11 +99,11 @@ module Fluent::Plugin
|
|
100
99
|
write_to_splunk(chunk)
|
101
100
|
end
|
102
101
|
|
103
|
-
@metrics[:record_counter].increment(metric_labels, chunk.
|
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,
|
102
|
+
@metrics[:record_counter].increment(labels: metric_labels, by: chunk.size)
|
103
|
+
@metrics[:bytes_counter].increment(labels: metric_labels, by: chunk.bytesize)
|
104
|
+
@metrics[:write_records_histogram].observe(chunk.size, labels: metric_labels)
|
105
|
+
@metrics[:write_bytes_histogram].observe(chunk.bytesize, labels: metric_labels, )
|
106
|
+
@metrics[:write_latency_histogram].observe(t, labels: metric_labels, )
|
108
107
|
end
|
109
108
|
|
110
109
|
def write_to_splunk(_chunk)
|
@@ -153,7 +152,7 @@ module Fluent::Plugin
|
|
153
152
|
def process_response(response, _request_body)
|
154
153
|
log.trace { "[Response] POST #{@api}: #{response.inspect}" }
|
155
154
|
|
156
|
-
@metrics[:status_counter].increment(metric_labels(status: response.code.to_s))
|
155
|
+
@metrics[:status_counter].increment(labels: metric_labels(status: response.code.to_s))
|
157
156
|
|
158
157
|
raise_err = response.code.to_s.start_with?('5') || (!@consume_chunk_on_4xx_errors && response.code.to_s.start_with?('4'))
|
159
158
|
|
@@ -193,8 +192,8 @@ module Fluent::Plugin
|
|
193
192
|
v = instance_variable_get "@#{f}"
|
194
193
|
next unless v
|
195
194
|
|
196
|
-
if v
|
197
|
-
instance_variable_set "@#{f}", ->(tag, _) { tag }
|
195
|
+
if v.include? TAG_PLACEHOLDER
|
196
|
+
instance_variable_set "@#{f}", ->(tag, _) { v.gsub(TAG_PLACEHOLDER, tag) }
|
198
197
|
else
|
199
198
|
instance_variable_set "@#{f}", ->(_, _) { v }
|
200
199
|
end
|
@@ -235,28 +234,34 @@ module Fluent::Plugin
|
|
235
234
|
|
236
235
|
@metrics = {
|
237
236
|
record_counter: register_metric(::Prometheus::Client::Counter.new(
|
238
|
-
:splunk_output_write_records_count,
|
239
|
-
'The number of log records being sent'
|
237
|
+
:splunk_output_write_records_count, docstring:
|
238
|
+
'The number of log records being sent',
|
239
|
+
labels: metric_label_keys
|
240
240
|
)),
|
241
241
|
bytes_counter: register_metric(::Prometheus::Client::Counter.new(
|
242
|
-
:splunk_output_write_bytes_count,
|
243
|
-
'The number of log bytes being sent'
|
242
|
+
:splunk_output_write_bytes_count, docstring:
|
243
|
+
'The number of log bytes being sent',
|
244
|
+
labels: metric_label_keys
|
244
245
|
)),
|
245
246
|
status_counter: register_metric(::Prometheus::Client::Counter.new(
|
246
|
-
:splunk_output_write_status_count,
|
247
|
-
'The count of sends by response_code'
|
247
|
+
:splunk_output_write_status_count, docstring:
|
248
|
+
'The count of sends by response_code',
|
249
|
+
labels: metric_label_keys(status: "")
|
248
250
|
)),
|
249
251
|
write_bytes_histogram: register_metric(::Prometheus::Client::Histogram.new(
|
250
|
-
:splunk_output_write_payload_bytes,
|
251
|
-
'The size of the write payload in bytes',
|
252
|
+
:splunk_output_write_payload_bytes, docstring:
|
253
|
+
'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],
|
254
|
+
labels: metric_label_keys
|
252
255
|
)),
|
253
256
|
write_records_histogram: register_metric(::Prometheus::Client::Histogram.new(
|
254
|
-
:splunk_output_write_payload_records,
|
255
|
-
'The number of records written per write',
|
257
|
+
:splunk_output_write_payload_records, docstring:
|
258
|
+
'The number of records written per write', buckets: [1, 10, 25, 100, 200, 300, 500, 750, 1000, 1500],
|
259
|
+
labels: metric_label_keys
|
256
260
|
)),
|
257
261
|
write_latency_histogram: register_metric(::Prometheus::Client::Histogram.new(
|
258
|
-
:splunk_output_write_latency_seconds,
|
259
|
-
'The latency of writes'
|
262
|
+
:splunk_output_write_latency_seconds, docstring:
|
263
|
+
'The latency of writes',
|
264
|
+
labels: metric_label_keys
|
260
265
|
))
|
261
266
|
}
|
262
267
|
end
|
@@ -266,6 +271,10 @@ module Fluent::Plugin
|
|
266
271
|
@metric_labels.merge other_labels
|
267
272
|
end
|
268
273
|
|
274
|
+
def metric_label_keys(other_labels = {})
|
275
|
+
(@metric_labels.merge other_labels).keys
|
276
|
+
end
|
277
|
+
|
269
278
|
# Encode as UTF-8. If 'coerce_to_utf8' is set to true in the config, any
|
270
279
|
# non-UTF-8 character would be replaced by the string specified by
|
271
280
|
# '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,11 +135,15 @@ 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
|
139
142
|
|
143
|
+
def write(chunk)
|
144
|
+
super
|
145
|
+
end
|
146
|
+
|
140
147
|
def start
|
141
148
|
super
|
142
149
|
@conn = Net::HTTP::Persistent.new.tap do |c|
|
@@ -279,9 +286,17 @@ module Fluent::Plugin
|
|
279
286
|
end
|
280
287
|
|
281
288
|
def construct_api
|
282
|
-
|
289
|
+
if @full_url.empty?
|
290
|
+
URI("#{@protocol}://#{@hec_host}:#{@hec_port}/services/collector")
|
291
|
+
else
|
292
|
+
URI("#{@full_url.delete_suffix("/")}/services/collector")
|
293
|
+
end
|
283
294
|
rescue StandardError
|
284
|
-
|
295
|
+
if @full_url.empty?
|
296
|
+
raise Fluent::ConfigError, "hec_host (#{@hec_host}) and/or hec_port (#{@hec_port}) are invalid."
|
297
|
+
else
|
298
|
+
raise Fluent::ConfigError, "full_url (#{@full_url}) is invalid."
|
299
|
+
end
|
285
300
|
end
|
286
301
|
|
287
302
|
def new_connection
|
@@ -312,10 +327,13 @@ module Fluent::Plugin
|
|
312
327
|
post.body = chunk.read
|
313
328
|
log.debug { "[Sending] Chunk: #{dump_unique_id_hex(chunk.unique_id)}(#{post.body.bytesize}B)." }
|
314
329
|
log.trace { "POST #{@api} body=#{post.body}" }
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
330
|
+
begin
|
331
|
+
t1 = Time.now
|
332
|
+
response = @conn.request @api, post
|
333
|
+
t2 = Time.now
|
334
|
+
rescue Net::HTTP::Persistent::Error => e
|
335
|
+
raise e.cause
|
336
|
+
end
|
319
337
|
|
320
338
|
raise_err = response.code.to_s.start_with?('5') || (!@consume_chunk_on_4xx_errors && response.code.to_s.start_with?('4'))
|
321
339
|
|
@@ -41,6 +41,10 @@ module Fluent::Plugin
|
|
41
41
|
super
|
42
42
|
end
|
43
43
|
|
44
|
+
def write(chunk)
|
45
|
+
super
|
46
|
+
end
|
47
|
+
|
44
48
|
def construct_api
|
45
49
|
uri = "https://#{@ingest_api_host}/#{@ingest_api_tenant}#{@ingest_api_events_endpoint}"
|
46
50
|
URI(uri)
|
@@ -101,7 +105,7 @@ module Fluent::Plugin
|
|
101
105
|
end
|
102
106
|
|
103
107
|
def write_to_splunk(chunk)
|
104
|
-
log.trace "#{self.class}: In write() with #{chunk.
|
108
|
+
log.trace "#{self.class}: In write() with #{chunk.size} records and #{chunk.bytesize} bytes "
|
105
109
|
# ingest API is an array of json objects
|
106
110
|
body = "[#{chunk.read.chomp(',')}]"
|
107
111
|
@conn ||= new_connection
|
@@ -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.10
|
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:
|
11
|
+
date: 2022-02-02 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
|
@@ -231,17 +217,17 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
231
217
|
version: '0'
|
232
218
|
requirements: []
|
233
219
|
rubygems_version: 3.1.4
|
234
|
-
signing_key:
|
220
|
+
signing_key:
|
235
221
|
specification_version: 4
|
236
222
|
summary: Fluentd plugin for Splunk HEC.
|
237
223
|
test_files:
|
238
|
-
- test/
|
224
|
+
- test/test_helper.rb
|
239
225
|
- test/fluent/plugin/out_splunk_ingest_api_test.rb
|
240
|
-
- test/
|
226
|
+
- test/fluent/plugin/out_splunk_hec_test.rb
|
241
227
|
- 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
228
|
- test/lib/webmock/http_lib_adapters/curb_adapter.rb
|
229
|
+
- test/lib/webmock/http_lib_adapters/patron_adapter.rb
|
245
230
|
- test/lib/webmock/http_lib_adapters/http_rb_adapter.rb
|
231
|
+
- test/lib/webmock/http_lib_adapters/typhoeus_hydra_adapter.rb
|
246
232
|
- test/lib/webmock/http_lib_adapters/excon_adapter.rb
|
247
|
-
- test/
|
233
|
+
- test/lib/webmock/http_lib_adapters/em_http_request_adapter.rb
|