fluent-plugin-opensearch 1.0.3 → 1.0.4
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/README.md +2 -2
- data/fluent-plugin-opensearch.gemspec +1 -1
- data/lib/fluent/plugin/opensearch_index_template.rb +2 -2
- data/lib/fluent/plugin/out_opensearch_data_stream.rb +0 -15
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d2bf385e2b57f561be89d6ccb74da8a95870668368643321c9217a83683d3ca
|
4
|
+
data.tar.gz: a5e622af13e62991eac0845ef4e0d33e12252f18c5073d335b78b8dc7055c2f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88ad2347a77fdd8a95851f53514def3396e424634a1e906c7700b875000881e5cd6825d8441cc765912e838dc9b2068702949d6722343fac0d476b9993fb3c35
|
7
|
+
data.tar.gz: b0f852ea5f3b42778ebfcad0d32a657a554077806e3e500dc9eb4bb7625cc95188aded8437d6ba7ca43eeafdecfa4dd40f01220f2956d78b9eb9b476d2e6ece9
|
data/History.md
CHANGED
data/README.md
CHANGED
@@ -1047,11 +1047,11 @@ $ fluentd -r $sniffer [AND YOUR OTHER OPTIONS]
|
|
1047
1047
|
The default selector used by the `OpenSearch::Transport` class works well when Fluentd should behave round robin and random selector cases. This doesn't work well when Fluentd should behave fallbacking from exhausted ES cluster to normal ES cluster.
|
1048
1048
|
The parameter `selector_class_name` gives you the ability to provide your own Selector class to implement whatever selection nodes logic you require.
|
1049
1049
|
|
1050
|
-
The below configuration is using plugin built-in `
|
1050
|
+
The below configuration is using plugin built-in `OpenSearchFallbackSelector`:
|
1051
1051
|
|
1052
1052
|
```
|
1053
1053
|
hosts exhausted-host:9201,normal-host:9200
|
1054
|
-
selector_class_name "Fluent::Plugin::
|
1054
|
+
selector_class_name "Fluent::Plugin::OpenSeartchFallbackSelector"
|
1055
1055
|
```
|
1056
1056
|
|
1057
1057
|
#### Tips
|
@@ -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-opensearch'
|
6
|
-
s.version = '1.0.
|
6
|
+
s.version = '1.0.4'
|
7
7
|
s.authors = ['Hiroshi Hatake']
|
8
8
|
s.email = ['cosmo0920.wp@gmail.com']
|
9
9
|
s.description = %q{Opensearch output plugin for Fluent event collector}
|
@@ -62,10 +62,10 @@ module Fluent::OpenSearchIndexTemplate
|
|
62
62
|
client.transport.transport.host_unreachable_exceptions
|
63
63
|
end
|
64
64
|
|
65
|
-
def retry_operate(max_retries, fail_on_retry_exceed = true,
|
65
|
+
def retry_operate(max_retries, fail_on_retry_exceed = true, catch_transport_exceptions = true)
|
66
66
|
return unless block_given?
|
67
67
|
retries = 0
|
68
|
-
transport_errors = OpenSearch::Transport::Transport::Errors.constants.map{ |c| OpenSearch::Transport::Transport::Errors.const_get c } if
|
68
|
+
transport_errors = OpenSearch::Transport::Transport::Errors.constants.map{ |c| OpenSearch::Transport::Transport::Errors.const_get c } if catch_transport_exceptions
|
69
69
|
begin
|
70
70
|
yield
|
71
71
|
rescue *host_unreachable_exceptions, *transport_errors, Timeout::Error => e
|
@@ -36,7 +36,6 @@ module Fluent::Plugin
|
|
36
36
|
@fail_on_putting_template_retry_exceed,
|
37
37
|
@catch_transport_exception_on_retry) do
|
38
38
|
create_index_template(@data_stream_name, @data_stream_template_name)
|
39
|
-
create_data_stream(@data_stream_name)
|
40
39
|
end
|
41
40
|
rescue => e
|
42
41
|
raise Fluent::ConfigError, "Failed to create data stream: <#{@data_stream_name}> #{e.message}"
|
@@ -105,19 +104,6 @@ module Fluent::Plugin
|
|
105
104
|
end
|
106
105
|
end
|
107
106
|
|
108
|
-
def create_data_stream(datastream_name, host = nil)
|
109
|
-
return if data_stream_exist?(datastream_name, host)
|
110
|
-
params = {
|
111
|
-
name: datastream_name
|
112
|
-
}
|
113
|
-
retry_operate(@max_retry_putting_template,
|
114
|
-
@fail_on_putting_template_retry_exceed,
|
115
|
-
@catch_transport_exception_on_retry) do
|
116
|
-
# TODO: Use X-Pack equivalent performing DataStream operation method on the following line
|
117
|
-
client(host).perform_request('PUT', "/_data_stream/#{datastream_name}", {}, params)
|
118
|
-
end
|
119
|
-
end
|
120
|
-
|
121
107
|
def template_exists?(name, host = nil)
|
122
108
|
if @use_legacy_template
|
123
109
|
client(host).indices.get_template(:name => name)
|
@@ -176,7 +162,6 @@ module Fluent::Plugin
|
|
176
162
|
unless @data_stream_names.include?(data_stream_name)
|
177
163
|
begin
|
178
164
|
create_index_template(data_stream_name, data_stream_template_name, host)
|
179
|
-
create_data_stream(data_stream_name, host)
|
180
165
|
@data_stream_names << data_stream_name
|
181
166
|
rescue => e
|
182
167
|
raise Fluent::ConfigError, "Failed to create data stream: <#{data_stream_name}> #{e.message}"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-opensearch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hiroshi Hatake
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
@@ -242,7 +242,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
242
242
|
- !ruby/object:Gem::Version
|
243
243
|
version: '0'
|
244
244
|
requirements: []
|
245
|
-
rubygems_version: 3.2.
|
245
|
+
rubygems_version: 3.2.32
|
246
246
|
signing_key:
|
247
247
|
specification_version: 4
|
248
248
|
summary: Opensearch output plugin for Fluent event collector
|