fluent-plugin-elasticsearch 5.4.0 → 5.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.md +3 -0
- data/fluent-plugin-elasticsearch.gemspec +1 -1
- data/lib/fluent/plugin/elasticsearch_compat.rb +1 -0
- data/lib/fluent/plugin/elasticsearch_index_lifecycle_management.rb +9 -9
- data/lib/fluent/plugin/out_elasticsearch_data_stream.rb +4 -4
- data/test/plugin/test_elasticsearch_index_lifecycle_management.rb +3 -7
- data/test/plugin/test_out_elasticsearch.rb +3 -15
- data/test/plugin/test_out_elasticsearch_data_stream.rb +1 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61bd10f31500ee04a5f1cbf8f9a25a22c8cf22feac51ce7728c1adec21f63565
|
4
|
+
data.tar.gz: 73f6a791314e73d4669b26105b3377ad99a90948e4f153086c0188484119f5ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f2ddddd3297b4c69a1499f0dcd4e3b690224523afacce1787f2490bee809ea2cc6d81cbf723fb3ce4275ca4a9ea83a1e7da908b33ff86c94fa79799fd6cabb4
|
7
|
+
data.tar.gz: cecb42477e365df347ebdfeded701f2faebf1084c01a76b1b4319920c241af6f785cebff47531181de8d3eeea03d50783df5c44c46202b95ef28bb42e366168d
|
data/History.md
CHANGED
@@ -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 = '5.4.
|
6
|
+
s.version = '5.4.1'
|
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}
|
@@ -45,19 +45,19 @@ module Fluent::Plugin::ElasticsearchIndexLifecycleManagement
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def get_ilm_policy
|
48
|
-
if Gem::Version.new(
|
49
|
-
client.ilm.
|
48
|
+
if Gem::Version.new(Elasticsearch::VERSION) >= Gem::Version.new("8.0.0")
|
49
|
+
client.ilm.get_lifecycle
|
50
50
|
else
|
51
|
-
client.
|
51
|
+
client.ilm.get_policy
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
55
|
def ilm_policy_exists?(policy_id)
|
56
56
|
begin
|
57
|
-
if Gem::Version.new(
|
58
|
-
client.ilm.
|
57
|
+
if Gem::Version.new(Elasticsearch::VERSION) >= Gem::Version.new("8.0.0")
|
58
|
+
client.ilm.get_lifecycle(policy: policy_id)
|
59
59
|
else
|
60
|
-
client.
|
60
|
+
client.ilm.get_policy(policy_id: policy_id)
|
61
61
|
end
|
62
62
|
true
|
63
63
|
rescue
|
@@ -67,10 +67,10 @@ module Fluent::Plugin::ElasticsearchIndexLifecycleManagement
|
|
67
67
|
|
68
68
|
def ilm_policy_put(policy_id, policy)
|
69
69
|
log.info("Installing ILM policy: #{policy}")
|
70
|
-
if Gem::Version.new(
|
71
|
-
client.ilm.
|
70
|
+
if Gem::Version.new(Elasticsearch::VERSION) >= Gem::Version.new("8.0.0")
|
71
|
+
client.ilm.put_lifecycle(policy: policy_id, body: policy)
|
72
72
|
else
|
73
|
-
client.
|
73
|
+
client.ilm.put_policy(policy_id: policy_id, body: policy)
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
@@ -102,8 +102,8 @@ module Fluent::Plugin
|
|
102
102
|
retry_operate(@max_retry_putting_template,
|
103
103
|
@fail_on_putting_template_retry_exceed,
|
104
104
|
@catch_transport_exception_on_retry) do
|
105
|
-
if Gem::Version.new(
|
106
|
-
client(host).
|
105
|
+
if Gem::Version.new(Elasticsearch::VERSION) >= Gem::Version.new("8.0.0")
|
106
|
+
client(host).ilm.put_lifecycle(params.merge(policy: ilm_name))
|
107
107
|
else
|
108
108
|
client(host).xpack.ilm.put_policy(params.merge(policy_id: ilm_name))
|
109
109
|
end
|
@@ -159,8 +159,8 @@ module Fluent::Plugin
|
|
159
159
|
|
160
160
|
def ilm_policy_exists?(policy_id, host = nil)
|
161
161
|
begin
|
162
|
-
if Gem::Version.new(
|
163
|
-
client(host).
|
162
|
+
if Gem::Version.new(Elasticsearch::VERSION) >= Gem::Version.new("8.0.0")
|
163
|
+
client(host).ilm.get_lifecycle(policy: policy_id)
|
164
164
|
else
|
165
165
|
client(host).ilm.get_policy(policy_id: policy_id)
|
166
166
|
end
|
@@ -38,19 +38,15 @@ class TestElasticsearchIndexLifecycleManagement < Test::Unit::TestCase
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def ilm_existence_endpoint(policy_id)
|
41
|
-
if Gem::Version.new(
|
42
|
-
"
|
41
|
+
if Gem::Version.new(Elasticsearch::VERSION) >= Gem::Version.new("8.0.0")
|
42
|
+
"_ilm/policy/#{policy_id}"
|
43
43
|
else
|
44
44
|
"_ilm/policy/%7B:policy_id=%3E%22#{policy_id}%22%7D"
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
48
|
def ilm_creation_endpoint(policy_id)
|
49
|
-
|
50
|
-
"_enrich/policy/#{policy_id}"
|
51
|
-
else
|
52
|
-
"_ilm/policy/#{policy_id}"
|
53
|
-
end
|
49
|
+
"_ilm/policy/#{policy_id}"
|
54
50
|
end
|
55
51
|
|
56
52
|
def stub_elastic_info(url="http://localhost:9200/", version=elasticsearch_version)
|
@@ -524,11 +524,7 @@ class ElasticsearchOutputTest < Test::Unit::TestCase
|
|
524
524
|
end
|
525
525
|
|
526
526
|
def ilm_endpoint
|
527
|
-
|
528
|
-
'_enrich'.freeze
|
529
|
-
else
|
530
|
-
'_ilm'.freeze
|
531
|
-
end
|
527
|
+
'_ilm'.freeze
|
532
528
|
end
|
533
529
|
|
534
530
|
data("legacy_template" => [true, "_template"],
|
@@ -1179,11 +1175,7 @@ class ElasticsearchOutputTest < Test::Unit::TestCase
|
|
1179
1175
|
end
|
1180
1176
|
|
1181
1177
|
def ilm_endpoint
|
1182
|
-
|
1183
|
-
'_enrich'.freeze
|
1184
|
-
else
|
1185
|
-
'_ilm'.freeze
|
1186
|
-
end
|
1178
|
+
'_ilm'.freeze
|
1187
1179
|
end
|
1188
1180
|
|
1189
1181
|
data("legacy_template" => [true, "_template"],
|
@@ -2601,11 +2593,7 @@ class ElasticsearchOutputTest < Test::Unit::TestCase
|
|
2601
2593
|
|
2602
2594
|
|
2603
2595
|
def ilm_endpoint
|
2604
|
-
|
2605
|
-
'_enrich'.freeze
|
2606
|
-
else
|
2607
|
-
'_ilm'.freeze
|
2608
|
-
end
|
2596
|
+
'_ilm'.freeze
|
2609
2597
|
end
|
2610
2598
|
|
2611
2599
|
data("legacy_template" => [true, "_template"],
|
@@ -31,11 +31,7 @@ class ElasticsearchOutputDataStreamTest < Test::Unit::TestCase
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def ilm_endpoint
|
34
|
-
|
35
|
-
'_enrich'.freeze
|
36
|
-
else
|
37
|
-
'_ilm'.freeze
|
38
|
-
end
|
34
|
+
'_ilm'.freeze
|
39
35
|
end
|
40
36
|
|
41
37
|
def driver(conf='', es_version=elasticsearch_version.to_i, client_version=elasticsearch_version)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-elasticsearch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.4.
|
4
|
+
version: 5.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- diogo
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2023-11-
|
13
|
+
date: 2023-11-27 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: fluentd
|