fluent-plugin-elasticsearch 2.1.0 → 2.1.1

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
  SHA1:
3
- metadata.gz: 16f9f3e664e714be9d1e7fee4b3f8a1683ec9728
4
- data.tar.gz: beb9fa49cb58739036a3f2c1cda6ee936fbd873d
3
+ metadata.gz: 97d1627c0193a5dce42c5154bc62c1609e18dd9e
4
+ data.tar.gz: e37519936763de220cc909f3bcb77b6cb97ce7b5
5
5
  SHA512:
6
- metadata.gz: 8527ebae2dbdb312cc6ed32af668077f9560b74db612a4f5d381f758e4e9cb4aa6230a6859a4a72c3f2b944b1fbf07292a49804cd4648a81392259938f133bab
7
- data.tar.gz: 887830c553b5ed0350bf64aba4f38d24c28c557fad5493c3ae5f350049269737645e93addfac89b0c252898d07cc127707a9d35f23470ea45cd35f5df48839e0
6
+ metadata.gz: 918c75ef1df3f9bbbe40c83db330c22618fcddfadcdffd6d02a73a6dc647939899fc3d2f4a3c4b553e16e9cb6fe64d2814b43d064a85d89412a893eecca5f5f1
7
+ data.tar.gz: 13e526c7723c3db9889549a57c808591ee2793f981be0dcf0ffa375828bbe33ff59d790df60da8e38499b7d59885821c0672621cf51456030329bf5ab3f48b89
data/History.md CHANGED
@@ -4,6 +4,10 @@
4
4
  - Log ES response errors (#230)
5
5
  - Use latest elasticsearch-ruby (#240)
6
6
 
7
+ ### 2.1.1
8
+ - Raise ConfigError when specifying different @hash_config.hash_id_key and id_key configration (#327)
9
+ - Small typo fix in README.md (#325)
10
+
7
11
  ### 2.1.0
8
12
  - Retry on certain errors from Elasticsearch (#322)
9
13
 
data/README.md CHANGED
@@ -563,7 +563,9 @@ Here is a sample config:
563
563
  ```
564
564
  <hash>
565
565
  hash_id_key _id # storing generated hash id key
566
- <hash>
566
+ hash_id_key _hash # storing generated hash id key
567
+ </hash>
568
+ id_key _hash # specify same key name which is specified in hash_id_key
567
569
  ```
568
570
 
569
571
  ### Not seeing a config you need?
@@ -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 = '2.1.0'
6
+ s.version = '2.1.1'
7
7
  s.authors = ['diogo', 'pitr']
8
8
  s.email = ['pitr.vern@gmail.com', 'me@diogoterror.com']
9
9
  s.description = %q{ElasticSearch output plugin for Fluent event collector}
@@ -7,7 +7,7 @@ module Fluent
7
7
  def self.included(klass)
8
8
  klass.instance_eval {
9
9
  config_section :hash, param_name: :hash_config, required: false, multi: false do
10
- config_param :hash_id_key, :string, default: '_id'
10
+ config_param :hash_id_key, :string, default: '_hash'
11
11
  end
12
12
  }
13
13
  end
@@ -134,6 +134,10 @@ module Fluent::Plugin
134
134
  if @password && m = @password.match(/%{(?<password>.*)}/)
135
135
  @password = URI.encode_www_form_component(m["password"])
136
136
  end
137
+
138
+ if @hash_config
139
+ raise Fluent::ConfigError, "@hash_config.hash_id_key and id_key must be equal." unless @hash_config.hash_id_key == @id_key
140
+ end
137
141
  end
138
142
 
139
143
  def create_meta_config_map
@@ -227,6 +227,21 @@ class ElasticsearchOutput < Test::Unit::TestCase
227
227
  end
228
228
  end
229
229
 
230
+ test 'with invaild generate id config' do
231
+ assert_raise(Fluent::ConfigError) {
232
+ driver.configure(Fluent::Config::Element.new(
233
+ 'ROOT', '', {
234
+ '@type' => 'elasticsearch',
235
+ 'id_key' =>'id_mismatch',
236
+ }, [
237
+ Fluent::Config::Element.new('hash', '', {
238
+ 'hash_id_key' => '_hash',
239
+ }, [])
240
+ ]
241
+ ))
242
+ }
243
+ end
244
+
230
245
  def test_template_already_present
231
246
  config = %{
232
247
  host logs.google.com
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: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - diogo
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-11-20 00:00:00.000000000 Z
12
+ date: 2017-11-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fluentd