fluent-plugin-elasticsearch 5.4.4 → 6.0.0
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/History.md +3 -0
- data/fluent-plugin-elasticsearch.gemspec +1 -1
- data/lib/fluent/plugin/out_elasticsearch.rb +17 -2
- data/test/plugin/test_out_elasticsearch.rb +8 -1
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b54470881e62c1a0c6fccc56867faf07ecbe210a0926a8073fc646fcd2ffc9e1
|
4
|
+
data.tar.gz: f973db55d17915664f6cb59676738c62f7408c3d94734cdb54b76025d62d82c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45a60caf34b6e02e5e2a46fd02535a3fa1648d1feb712c1d20c1a88f041c29a39fe688afba1c88511a572075db7e98c767ad81b4197b6bc56a1e1e27d9149764
|
7
|
+
data.tar.gz: 2e0d0dab94d7c3112b637f185c9df0bf16c2fb1805d9186de2fecf6d25e66eea269482431b2db20b62e66f16ebcbd66dd576d6e1e957c12c29d68728b7132806
|
data/History.md
CHANGED
@@ -2,6 +2,9 @@
|
|
2
2
|
|
3
3
|
### [Unreleased]
|
4
4
|
|
5
|
+
### 6.0.0
|
6
|
+
- Adjust Content-Type and Accept headers for sending logs into ES9 (#1064)
|
7
|
+
|
5
8
|
### 5.4.4
|
6
9
|
- docs: Clarify README docs for template_name and templates (#1043)
|
7
10
|
- `out_elasticsearch_data_stream`: Avoid long worrying log line at info level (#1044)
|
@@ -3,7 +3,7 @@ $:.push File.expand_path('../lib', __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = 'fluent-plugin-elasticsearch'
|
6
|
-
s.version = '
|
6
|
+
s.version = '6.0.0'
|
7
7
|
s.authors = ['diogo', 'pitr', 'Hiroshi Hatake']
|
8
8
|
s.email = ['pitr.vern@gmail.com', 'me@diogoterror.com', 'cosmo0920.wp@gmail.com']
|
9
9
|
s.description = %q{Elasticsearch output plugin for Fluent event collector}
|
@@ -73,6 +73,7 @@ module Fluent::Plugin
|
|
73
73
|
DEFAULT_RELOAD_AFTER = -1
|
74
74
|
DEFAULT_TARGET_BULK_BYTES = -1
|
75
75
|
DEFAULT_POLICY_ID = "logstash-policy"
|
76
|
+
ES9_CONTENT_TYPE = "application/vnd.elasticsearch+x-ndjson; compatible-with=9"
|
76
77
|
|
77
78
|
config_param :host, :string, :default => 'localhost'
|
78
79
|
config_param :port, :integer, :default => 9200
|
@@ -350,10 +351,22 @@ EOC
|
|
350
351
|
log.warn "Detected ES 7.x: `_doc` will be used as the document `_type`."
|
351
352
|
@type_name = '_doc'.freeze
|
352
353
|
end
|
353
|
-
if @last_seen_major_version
|
354
|
-
log.debug "Detected ES 8.x
|
354
|
+
if @last_seen_major_version == 8 && @type_name != DEFAULT_TYPE_NAME_ES_7x
|
355
|
+
log.debug "Detected ES 8.x: This parameter has no effect."
|
355
356
|
@type_name = nil
|
356
357
|
end
|
358
|
+
if @last_seen_major_version >= 9
|
359
|
+
if @type_name != DEFAULT_TYPE_NAME_ES_7x
|
360
|
+
log.debug "Detected ES 9.x or above: This parameter has no effect."
|
361
|
+
@type_name = nil
|
362
|
+
end
|
363
|
+
@accept_type = nil
|
364
|
+
if @content_type != ES9_CONTENT_TYPE
|
365
|
+
log.trace "Detected ES 9.x or above: Content-Type will be adjusted."
|
366
|
+
@content_type = ES9_CONTENT_TYPE
|
367
|
+
@accept_type = ES9_CONTENT_TYPE
|
368
|
+
end
|
369
|
+
end
|
357
370
|
end
|
358
371
|
|
359
372
|
if @validate_client_version && !dry_run?
|
@@ -614,6 +627,8 @@ EOC
|
|
614
627
|
.merge(@custom_headers)
|
615
628
|
.merge(@api_key_header)
|
616
629
|
.merge(gzip_headers)
|
630
|
+
headers.merge!('Accept' => @accept_type) if @accept_type
|
631
|
+
|
617
632
|
ssl_options = { verify: @ssl_verify, ca_file: @ca_file}.merge(@ssl_version_options)
|
618
633
|
|
619
634
|
transport = TRANSPORT_CLASS::Transport::HTTP::Faraday.new(connection_options.merge(
|
@@ -90,7 +90,13 @@ class ElasticsearchOutputTest < Test::Unit::TestCase
|
|
90
90
|
end
|
91
91
|
|
92
92
|
def stub_elastic(url="http://localhost:9200/_bulk")
|
93
|
-
|
93
|
+
headers = if elasticsearch_miscellaneous_content_type?
|
94
|
+
{ "Content-Type" => "application/vnd.elasticsearch+x-ndjson; compatible-with=9" }
|
95
|
+
else
|
96
|
+
{}
|
97
|
+
end
|
98
|
+
|
99
|
+
stub_request(:post, url).with({headers: headers}) do |req|
|
94
100
|
@index_cmds = req.body.split("\n").map {|r| JSON.parse(r) }
|
95
101
|
end.to_return({:status => 200, :body => "", :headers => { 'Content-Type' => 'json', 'x-elastic-product' => 'Elasticsearch' } })
|
96
102
|
end
|
@@ -4016,6 +4022,7 @@ class ElasticsearchOutputTest < Test::Unit::TestCase
|
|
4016
4022
|
data('Elasticsearch 6' => [6, Fluent::Plugin::ElasticsearchOutput::DEFAULT_TYPE_NAME],
|
4017
4023
|
'Elasticsearch 7' => [7, Fluent::Plugin::ElasticsearchOutput::DEFAULT_TYPE_NAME_ES_7x],
|
4018
4024
|
'Elasticsearch 8' => [8, nil],
|
4025
|
+
'Elasticsearch 9' => [9, nil],
|
4019
4026
|
)
|
4020
4027
|
def test_writes_to_default_type(data)
|
4021
4028
|
version, index_type = data
|
metadata
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-elasticsearch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 6.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- diogo
|
8
8
|
- pitr
|
9
9
|
- Hiroshi Hatake
|
10
|
+
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
|
-
date:
|
13
|
+
date: 2025-05-09 00:00:00.000000000 Z
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: fluentd
|
@@ -235,6 +236,7 @@ licenses:
|
|
235
236
|
- Apache-2.0
|
236
237
|
metadata:
|
237
238
|
changelog_uri: https://github.com/uken/fluent-plugin-elasticsearch/blob/master/History.md
|
239
|
+
post_install_message:
|
238
240
|
rdoc_options: []
|
239
241
|
require_paths:
|
240
242
|
- lib
|
@@ -249,7 +251,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
249
251
|
- !ruby/object:Gem::Version
|
250
252
|
version: '0'
|
251
253
|
requirements: []
|
252
|
-
rubygems_version: 3.6
|
254
|
+
rubygems_version: 3.4.6
|
255
|
+
signing_key:
|
253
256
|
specification_version: 4
|
254
257
|
summary: Elasticsearch output plugin for Fluent event collector
|
255
258
|
test_files:
|