fluent-plugin-splunk-hec 1.3.1 → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6a8a63dd4210f66f194a029bceed3d3c407aaa3fb764b69961fc01efcb801d9e
4
- data.tar.gz: 8aab1ee69dd9c4cdcc2422da2720db89987c270b0acf4bcd01b97a908cf14763
3
+ metadata.gz: 95692f6f46749b89d1afb9d2c0f353e210c3a75bdb301e666a514461a921f144
4
+ data.tar.gz: bd2e18ac48003d0a7fe0e66ec01978b0f7fc8008488490a08eb0c3fe823ef5fa
5
5
  SHA512:
6
- metadata.gz: 4fe2f5eb7e22e8e9914754507add8d06df80be96b8fe8d2d57ce295730f77d948c16dde1bda4199ac63f2ab8798027841ec694c99113558405ad49d9000b50ab
7
- data.tar.gz: f2e69d508a72eb1f1e306e66f1defa6572e636f148e314c9cd26fee1d7f3c2b5dd437e65c41c5e7e6ee2a77e0f0aeb341d5d849ab60313ae3fefba096ce8a1d5
6
+ metadata.gz: 73a5f400dd4c5465ec673d909f4a11f4db4eeed4a9e2fa99198ea9535c603878f194ef5a7ec770717300d65e0b18c4fbecfd898c37946b922d574185fb8020c8
7
+ data.tar.gz: 0d74186b33138347b2ab9833cd2df57ad0ee5fcae053ba7db59b2feb351c014dbeb6665b527281967ce7dcdc6454dc186b80068b9e07c0a8734de658bf1e20c3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fluent-plugin-splunk-hec (1.3.1)
4
+ fluent-plugin-splunk-hec (1.3.2)
5
5
  fluentd (>= 1.5)
6
6
  json-jwt (~> 1.15.0)
7
7
  multi_json (~> 1.13)
@@ -13,9 +13,9 @@ PATH
13
13
  GEM
14
14
  remote: https://rubygems.org/
15
15
  specs:
16
- activemodel (7.0.4)
17
- activesupport (= 7.0.4)
18
- activesupport (7.0.4)
16
+ activemodel (7.0.4.3)
17
+ activesupport (= 7.0.4.3)
18
+ activesupport (7.0.4.3)
19
19
  concurrent-ruby (~> 1.0, >= 1.0.2)
20
20
  i18n (>= 1.6, < 2)
21
21
  minitest (>= 5.1)
@@ -25,7 +25,7 @@ GEM
25
25
  aes_key_wrap (1.1.0)
26
26
  attr_required (1.0.1)
27
27
  bindata (2.4.14)
28
- concurrent-ruby (1.1.10)
28
+ concurrent-ruby (1.2.2)
29
29
  connection_pool (2.3.0)
30
30
  cool.io (1.7.1)
31
31
  crack (0.4.5)
@@ -89,7 +89,7 @@ GEM
89
89
  power_assert (2.0.1)
90
90
  prometheus-client (4.0.0)
91
91
  public_suffix (4.0.6)
92
- rack (3.0.1)
92
+ rack (3.0.6.1)
93
93
  rack-oauth2 (1.21.2)
94
94
  activesupport
95
95
  attr_required
@@ -117,7 +117,7 @@ GEM
117
117
  test-unit (3.5.3)
118
118
  power_assert
119
119
  timeout (0.2.0)
120
- tzinfo (2.0.5)
120
+ tzinfo (2.0.6)
121
121
  concurrent-ruby (~> 1.0)
122
122
  tzinfo-data (1.2022.6)
123
123
  tzinfo (>= 1.0.0)
@@ -152,4 +152,4 @@ DEPENDENCIES
152
152
  webmock (~> 3.5.0)
153
153
 
154
154
  BUNDLED WITH
155
- 2.3.26
155
+ 2.4.9
data/README.md CHANGED
@@ -1,3 +1,7 @@
1
+ # End of Support
2
+
3
+ **Important:** The fluent-plugin-splunk-hec will reach End of Support on January 1, 2024. After that date, this repository will no longer receive updates from Splunk and will no longer be supported by Splunk. Until then, only critical security fixes and bug fixes will be provided.
4
+
1
5
  # fluent-plugin-splunk-hec
2
6
 
3
7
  [Fluentd](https://fluentd.org/) output plugin to send events and metrics to [Splunk](https://www.splunk.com) in 2 modes:<br/>
@@ -288,6 +292,10 @@ Splunk app name using this plugin (default to `hec_plugin_gem`)
288
292
 
289
293
  The version of Splunk app using this this plugin (default to plugin version)
290
294
 
295
+ ### custom_headers (Hash) (Optional)
296
+
297
+ Hash of custom headers to be added to the HTTP request. Used to populate [`override_headers`](https://docs.seattlerb.org/net-http-persistent/Net/HTTP/Persistent.html#attribute-i-override_headers) attribute of the underlying `Net::HTTP::Persistent` connection.
298
+
291
299
  #### When `data_type` is `event`
292
300
 
293
301
  In this case, parameters inside `<fields>` are used as indexed fields and removed from the original input events. Please see the "Add a "fields" property at the top JSON level" [here](http://dev.splunk.com/view/event-collector/SP-CAAAFB6) for details. Given we have configuration like
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.1
1
+ 1.3.2
@@ -134,6 +134,9 @@ module Fluent::Plugin
134
134
  DESC
135
135
  config_param :non_utf8_replacement_string, :string, :default => ' '
136
136
 
137
+ desc 'Any custom headers to include alongside requests made to Splunk'
138
+ config_param :custom_headers, :hash, :default => {}
139
+
137
140
  def initialize
138
141
  super
139
142
  @default_host = Socket.gethostname
@@ -168,7 +171,9 @@ module Fluent::Plugin
168
171
  c.override_headers['Authorization'] = "Splunk #{@hec_token}"
169
172
  c.override_headers['__splunk_app_name'] = "#{@app_name}"
170
173
  c.override_headers['__splunk_app_version'] = "#{@app_version}"
171
-
174
+ @custom_headers.each do |header, value|
175
+ c.override_headers[header] = value
176
+ end
172
177
  end
173
178
  end
174
179
 
@@ -66,6 +66,13 @@ describe Fluent::Plugin::SplunkHecOutput do
66
66
  it 'should support enabling gzip' do
67
67
  expect(create_hec_output_driver('hec_host hec_token', 'gzip_compression true').instance.gzip_compression).must_equal true
68
68
  end
69
+ it 'should define custom_headers as {} (hash) initially' do
70
+ assert_empty(create_hec_output_driver('hec_host hec_token').instance.custom_headers)
71
+ expect(create_hec_output_driver('hec_host hec_token').instance.custom_headers).is_a? Hash
72
+ end
73
+ it 'should allow setting custom_headers' do
74
+ assert_equal(create_hec_output_driver('hec_host hec_token', 'custom_headers {"custom":"header"}').instance.custom_headers, {"custom" => "header"})
75
+ end
69
76
  end
70
77
 
71
78
  describe 'hec_host validation' do
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.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Splunk Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-23 00:00:00.000000000 Z
11
+ date: 2023-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -249,13 +249,13 @@ signing_key:
249
249
  specification_version: 4
250
250
  summary: Fluentd plugin for Splunk HEC.
251
251
  test_files:
252
- - test/lib/webmock/http_lib_adapters/typhoeus_hydra_adapter.rb
253
- - test/lib/webmock/http_lib_adapters/curb_adapter.rb
252
+ - test/lib/webmock/http_lib_adapters/excon_adapter.rb
254
253
  - test/lib/webmock/http_lib_adapters/patron_adapter.rb
254
+ - test/lib/webmock/http_lib_adapters/typhoeus_hydra_adapter.rb
255
255
  - test/lib/webmock/http_lib_adapters/em_http_request_adapter.rb
256
- - test/lib/webmock/http_lib_adapters/excon_adapter.rb
257
- - test/lib/webmock/http_lib_adapters/http_rb_adapter.rb
256
+ - test/lib/webmock/http_lib_adapters/curb_adapter.rb
258
257
  - test/lib/webmock/http_lib_adapters/manticore_adapter.rb
258
+ - test/lib/webmock/http_lib_adapters/http_rb_adapter.rb
259
259
  - test/test_helper.rb
260
260
  - test/fluent/plugin/out_splunk_ingest_api_test.rb
261
261
  - test/fluent/plugin/out_splunk_hec_test.rb