fluent-plugin-opensearch 1.1.3 → 1.1.4

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: 8b8b954980a5eb5fd96702cac11352951aea3f3ed18485e151b4642f415ab026
4
- data.tar.gz: aeb250f72fa691f558471d88dfde6081c24115049ec995acbc7c58a2799cbecd
3
+ metadata.gz: 578e5c63061d5f1cb3f3729dee4ea630564dc60d82f6b047c8e4b23830fdf16a
4
+ data.tar.gz: a502d46eb5a3a59c5c4f65f9009623ff32fde1de4cfda7e181437a8720bdbda1
5
5
  SHA512:
6
- metadata.gz: 51a4428c631b285a8769e82cecc8d9c67e4f3f89cabb8b36520170a594e41ddda56729a6b9aaf6a43808063f6904624997a88fd522a7756dfc2cdea1e20a2b3f
7
- data.tar.gz: e301856f437a3dce63d7cf3012156f5ae80234a3faa572b00c3aee2a505e50087e8dfc8f763db1f72733457225c290e102887efe46bb3ae21c0a3e849e326900
6
+ metadata.gz: 77b3373041396440cf8debaea8fd2ab95b94df950cbfe6105f65d45cce7092a6f89bd019b38d4022051c651541d3d21918625ea1b9939f58108101eae90a027f
7
+ data.tar.gz: 2e746cd797f5d24f08dbb386ea42b9bff506831c56f9f4b92dcf99dde321b9b613c7473cbad39bd1f6d338ae6dd094a87f838141306111ab49b5a76886346918
data/History.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ### [Unreleased]
4
4
 
5
+ ### 1.1.4
6
+ - test: remove minitest to correct misjudge of the framework by flexmock (#114)
7
+ - Add logic to write method of out_opensearch_data_stream (#109)
8
+
5
9
  ### 1.1.3
6
10
  - Revert the behavior of passing duration second (#108)
7
11
 
data/README.md CHANGED
@@ -1606,7 +1606,7 @@ There are usually a few feature requests, tagged [Easy](https://github.com/fluen
1606
1606
 
1607
1607
  Pull Requests are welcomed.
1608
1608
 
1609
- Becore send a pull request or report an issue, please read [the contribution guideline](CONTRIBUTING.md).
1609
+ Before sending a pull request or reporting an issue, please read [the contribution guideline](CONTRIBUTING.md).
1610
1610
 
1611
1611
  ## Running tests
1612
1612
 
@@ -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.1.3'
6
+ s.version = '1.1.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}
@@ -187,6 +187,12 @@ module Fluent::Plugin
187
187
  dt = Time.at(time).to_datetime
188
188
  end
189
189
  record.merge!({"@timestamp" => dt.iso8601(@time_precision)})
190
+ if @include_tag_key
191
+ record[@tag_key] = tag
192
+ end
193
+ if @remove_keys
194
+ @remove_keys.each { |key| record.delete(key) }
195
+ end
190
196
  bulk_message = append_record_to_messages(CREATE_OP, {}, headers, record, bulk_message)
191
197
  rescue => e
192
198
  emit_error_label_event do
data/test/helper.rb CHANGED
@@ -55,7 +55,6 @@ end
55
55
 
56
56
  require 'test/unit'
57
57
  require 'fluent/test'
58
- require 'minitest/pride'
59
58
 
60
59
  require 'webmock/test_unit'
61
60
  WebMock.disable_net_connect!
@@ -678,4 +678,69 @@ class OpenSearchOutputDataStreamTest < Test::Unit::TestCase
678
678
  assert(index_cmds[1].has_key? '@timestamp')
679
679
  end
680
680
 
681
+ def test_record_with_include_tag_key
682
+ stub_default
683
+ stub_bulk_feed
684
+ stub_default
685
+ stub_bulk_feed
686
+ conf = config_element(
687
+ 'ROOT', '', {
688
+ '@type' => OPENSEARCH_DATA_STREAM_TYPE,
689
+ 'data_stream_name' => 'foo',
690
+ 'data_stream_template_name' => 'foo_tpl',
691
+ 'include_tag_key' => true,
692
+ 'tag_key' => 'test_tag'
693
+ })
694
+ record = {
695
+ 'message' => 'Sample Record'
696
+ }
697
+ driver(conf).run(default_tag: 'test') do
698
+ driver.feed(record)
699
+ end
700
+ assert(index_cmds[1].has_key?('test_tag'))
701
+ end
702
+
703
+ def test_record_without_include_tag_key
704
+ stub_default
705
+ stub_bulk_feed
706
+ stub_default
707
+ stub_bulk_feed
708
+ conf = config_element(
709
+ 'ROOT', '', {
710
+ '@type' => OPENSEARCH_DATA_STREAM_TYPE,
711
+ 'data_stream_name' => 'foo',
712
+ 'data_stream_template_name' => 'foo_tpl',
713
+ 'include_tag_key' => false
714
+ })
715
+ record = {
716
+ 'message' => 'Sample Record'
717
+ }
718
+ driver(conf).run(default_tag: 'test') do
719
+ driver.feed(record)
720
+ end
721
+ assert(!index_cmds[1].has_key?('test'))
722
+ end
723
+
724
+ def test_record_with_remove_keys
725
+ stub_default
726
+ stub_bulk_feed
727
+ stub_default
728
+ stub_bulk_feed
729
+ conf = config_element(
730
+ 'ROOT', '', {
731
+ '@type' => OPENSEARCH_DATA_STREAM_TYPE,
732
+ 'data_stream_name' => 'foo',
733
+ 'data_stream_template_name' => 'foo_tpl',
734
+ 'remove_keys' => 'remove_me'
735
+ })
736
+ record = {
737
+ 'message' => 'Sample Record',
738
+ 'remove_me' => 'foo'
739
+ }
740
+ driver(conf).run(default_tag: 'test') do
741
+ driver.feed(record)
742
+ end
743
+ assert(!index_cmds[1].has_key?('remove_me'))
744
+ end
745
+
681
746
  end
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.1.3
4
+ version: 1.1.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: 2023-07-02 00:00:00.000000000 Z
11
+ date: 2023-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd