fluent-plugin-opensearch 1.0.5 → 1.0.6

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: 0dc7a8e74a02c8940f19855c7377b7022e62ba0a9645e63eb2df366b0e085bb1
4
- data.tar.gz: 482ed0c66522385c60a0765fbd0852e6158050ed4f803b7fed8a7045faf67beb
3
+ metadata.gz: 988e07d44cf92e9f0a09dfa57191ac4acdfd3a3fb1cd9598f12cb3e196ea88ac
4
+ data.tar.gz: 786b826f8fdb04d2c16804c42efaa4c40042deb43f71bcb6bed31de13742b413
5
5
  SHA512:
6
- metadata.gz: ddab26f5bd880a43a29a345db493e7ceb39aafd5d6a583fd895975808041ee2856b125d579ffa64e8716f46e340e6a0e8d4079bc790b9a8b60f3ebcba1f53168
7
- data.tar.gz: 4e2e566e012edcab487b66c6e5ca2cfe0e0e87d4470bbc79704d830ee561789a16e537967d549a1d0ea687cf59a7cf86781de1ae7dfdd15928934a2fc86ecae0
6
+ metadata.gz: 9a6c39ce68b3d8616d490cd04006c85397ccf0fc4bb768f5f8182dad3f63abf5d29f721928ee7f074b361ba44d529e7080f99814300949ea5464ce4279ee1ba8
7
+ data.tar.gz: 8eb1f4a48740d1d85dfeb0d25de3877c2e4dcf4f228d0bc3f4907c952aad17327ee4f157972338dad21ce38a0b5b44571553b918aa096191444772c18ef6f2d9
data/History.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  ### [Unreleased]
4
4
 
5
+ ### 1.0.6
6
+ - out\_opensearch: Handle suppress\_type\_name operation correctly (#61)
7
+
5
8
  ### 1.0.5
6
9
  - Use if clause to detect requirements for emitting error label events (#57)
7
10
  - opensearch_data_stream: Align lowercases for data_stream and its template names (#50)
@@ -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.5'
6
+ s.version = '1.0.6'
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}
@@ -989,7 +989,7 @@ module Fluent::Plugin
989
989
  end
990
990
  end
991
991
 
992
- if @suppress_type_name
992
+ if @suppress_type_name || @last_seen_major_version >= 2
993
993
  target_type = nil
994
994
  else
995
995
  # OpenSearch only supports "_doc".
@@ -998,7 +998,7 @@ module Fluent::Plugin
998
998
 
999
999
  meta.clear
1000
1000
  meta["_index".freeze] = target_index
1001
- meta["_type".freeze] = target_type
1001
+ meta["_type".freeze] = target_type unless target_type.nil?
1002
1002
  meta["_alias".freeze] = target_index_alias
1003
1003
 
1004
1004
  if @pipeline
@@ -2320,8 +2320,9 @@ class OpenSearchOutputTest < Test::Unit::TestCase
2320
2320
  end
2321
2321
 
2322
2322
  data(
2323
- "OpenSearch default"=> {"os_version" => 1, "_type" => "_doc", "suppress_type" => false},
2324
- "Suppressed type" => {"os_version" => 1, "_type" => nil, "suppress_type" => true},
2323
+ "OpenSearch default" => {"os_version" => 1, "_type" => "_doc", "suppress_type" => false},
2324
+ "Suppressed type" => {"os_version" => 1, "_type" => nil, "suppress_type" => true},
2325
+ "OpenSearch 2" => {"os_version" => 2, "_type" => nil, "suppress_type" => true},
2325
2326
  )
2326
2327
  def test_writes_to_speficied_type(data)
2327
2328
  driver('', data["os_version"]).configure("suppress_type_name #{data['suppress_type']}")
@@ -2330,7 +2331,12 @@ class OpenSearchOutputTest < Test::Unit::TestCase
2330
2331
  driver.run(default_tag: 'test') do
2331
2332
  driver.feed(sample_record)
2332
2333
  end
2333
- assert_equal(data['_type'], index_cmds.first['index']['_type'])
2334
+ if data["suppress_type"] || data["os_version"] >= 2
2335
+ assert_false(index_cmds.first['index'].has_key?("_type"))
2336
+ else
2337
+ assert_true(index_cmds.first['index'].has_key?("_type"))
2338
+ assert_equal(data['_type'], index_cmds.first['index']['_type'])
2339
+ end
2334
2340
  end
2335
2341
 
2336
2342
  def test_writes_to_speficied_host
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.5
4
+ version: 1.0.6
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-05-25 00:00:00.000000000 Z
11
+ date: 2022-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd