fluent-plugin-elasticsearch 1.9.7 → 1.10.0

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: f51b14ce23cabf39514ac940e2264b20e6f286cf
4
- data.tar.gz: f0fcf4b3b932c25dc2581cdc956c7fab8fe3f93b
3
+ metadata.gz: d7f9583b7923380fe06d399cc24006cf75a17528
4
+ data.tar.gz: ffb1c9ed360ef6c48cfa003ee81022d179f0b9bf
5
5
  SHA512:
6
- metadata.gz: a2a1c31320d3c5ed755641984db54ec01004bb5ba65bb09f1fe32090af66096aaa3ca72ab3ab5ddfafc0d39e9f6552a60ef17b453dfbc1d08b5d2218f3aac362
7
- data.tar.gz: 2481710f0d2ebe1d95c1d95167acee5c629c9edc0a2c6b7608833c2db87c13fc054e5c8b393c54349430c68f3dd06dfd6de57066ba5d1209386a7bc0fefdfb0f
6
+ metadata.gz: 74eaadfe9d121623014befb052b8437cdb092a9857153c521039ee463ef51a20877f7f1e63dea4ad9c5f3a8f70ab33b0ea1c77cf0aa93fac0c33b0da63e15af6
7
+ data.tar.gz: 4a84606298bf3e2874485c6d5d10212f065d89f68ab7bc44e0731cfa3908a2cefce18aa9eef51f1b2fb09248e9a98d8610ebc5bd3496b9223cbb4245e00d6b04
data/History.md CHANGED
@@ -4,6 +4,11 @@
4
4
  - Log ES response errors (#230)
5
5
  - Use latest elasticsearch-ruby (#240)
6
6
 
7
+ ### 1.10.0
8
+ - backport adding `logstash_prefix_separator` parameter fix
9
+ - backport making configuraable SSL/TLS version (#300)
10
+ - bump up minimum required Fluentd version to v0.12.10 due to use enum parameter type
11
+
7
12
  ### 1.9.7
8
13
  - fix license identifier in gemspec (#295)
9
14
 
data/README.md CHANGED
@@ -19,6 +19,7 @@ Note: For Amazon Elasticsearch Service please consider using [fluent-plugin-aws-
19
19
  + [user, password, path, scheme, ssl_verify](#user-password-path-scheme-ssl_verify)
20
20
  + [logstash_format](#logstash_format)
21
21
  + [logstash_prefix](#logstash_prefix)
22
+ + [logstash_prefix_separator](#logstash_prefix_separator)
22
23
  + [logstash_dateformat](#logstash_dateformat)
23
24
  + [pipeline](#pipeline)
24
25
  + [time_key_format](#time_key_format)
@@ -122,6 +123,12 @@ This is meant to make writing data into ElasticSearch indices compatible to what
122
123
  logstash_prefix mylogs # defaults to "logstash"
123
124
  ```
124
125
 
126
+ ### logstash_prefix_separator
127
+
128
+ ```
129
+ logstash_prefix_separator _ # defaults to "-"
130
+ ```
131
+
125
132
  ### logstash_dateformat
126
133
 
127
134
  The strftime format to generate index target index name when `logstash_format` is set to true. By default, the records are inserted into index `logstash-YYYY.MM.DD`. This option, alongwith `logstash_prefix` lets us insert into specified index like `mylogs-YYYYMM` for a monthly index.
@@ -441,6 +448,11 @@ client_key /path/to/your/private/key
441
448
  client_key_pass password
442
449
  ```
443
450
 
451
+ If you want to configure SSL/TLS version, you can specify ssl\_version parameter.
452
+ ```
453
+ ssl_version TLSv1_2 # or [SSLv23, TLSv1, TLSv1_1]
454
+ ```
455
+
444
456
  ### Proxy Support
445
457
 
446
458
  Starting with version 0.8.0, this gem uses excon, which supports proxy with environment variables - https://github.com/excon/excon#proxy-support
@@ -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 = '1.9.7'
6
+ s.version = '1.10.0'
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}
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
18
18
 
19
19
  s.required_ruby_version = Gem::Requirement.new(">= 2.0".freeze)
20
20
 
21
- s.add_runtime_dependency 'fluentd', '>= 0.10.43'
21
+ s.add_runtime_dependency 'fluentd', '>= 0.12.10'
22
22
  s.add_runtime_dependency 'excon', '>= 0'
23
23
  s.add_runtime_dependency 'elasticsearch'
24
24
 
@@ -30,6 +30,7 @@ class Fluent::ElasticsearchOutput < Fluent::ObjectBufferedOutput
30
30
  config_param :time_precision, :integer, :default => 0
31
31
  config_param :logstash_format, :bool, :default => false
32
32
  config_param :logstash_prefix, :string, :default => "logstash"
33
+ config_param :logstash_prefix_separator, :string, :default => '-'
33
34
  config_param :logstash_dateformat, :string, :default => "%Y.%m.%d"
34
35
  config_param :utc_index, :bool, :default => true
35
36
  config_param :type_name, :string, :default => "fluentd"
@@ -49,6 +50,7 @@ class Fluent::ElasticsearchOutput < Fluent::ObjectBufferedOutput
49
50
  config_param :client_cert, :string, :default => nil
50
51
  config_param :client_key_pass, :string, :default => nil
51
52
  config_param :ca_file, :string, :default => nil
53
+ config_param :ssl_version, :enum, list: [:SSLv23, :TLSv1, :TLSv1_1, :TLSv1_2], :default => :TLSv1
52
54
  config_param :remove_keys, :string, :default => nil
53
55
  config_param :remove_keys_on_update, :string, :default => ""
54
56
  config_param :remove_keys_on_update_key, :string, :default => nil
@@ -154,7 +156,7 @@ class Fluent::ElasticsearchOutput < Fluent::ObjectBufferedOutput
154
156
  transport_options: {
155
157
  headers: { 'Content-Type' => 'application/json' },
156
158
  request: { timeout: @request_timeout },
157
- ssl: { verify: @ssl_verify, ca_file: @ca_file }
159
+ ssl: { verify: @ssl_verify, ca_file: @ca_file, version: @ssl_version }
158
160
  }
159
161
  }), &adapter_conf)
160
162
  es = Elasticsearch::Client.new transport: transport
@@ -305,7 +307,7 @@ class Fluent::ElasticsearchOutput < Fluent::ObjectBufferedOutput
305
307
  record[TIMESTAMP_FIELD] = dt.iso8601(@time_precision)
306
308
  end
307
309
  dt = dt.new_offset(0) if @utc_index
308
- target_index = "#{@logstash_prefix}-#{dt.strftime(@logstash_dateformat)}"
310
+ target_index = "#{@logstash_prefix}#{@logstash_prefix_separator}#{dt.strftime(@logstash_dateformat)}"
309
311
  else
310
312
  target_index = @index_name
311
313
  end
@@ -70,6 +70,10 @@ class ElasticsearchOutput < Test::Unit::TestCase
70
70
  assert_equal '/es/', instance.path
71
71
  assert_equal 'john', instance.user
72
72
  assert_equal 'doe', instance.password
73
+ assert_equal :TLSv1, instance.ssl_version
74
+ assert_nil instance.client_key
75
+ assert_nil instance.client_cert
76
+ assert_nil instance.client_key_pass
73
77
  end
74
78
 
75
79
  def test_template_already_present
@@ -645,6 +649,20 @@ class ElasticsearchOutput < Test::Unit::TestCase
645
649
  assert_equal(logstash_index, index_cmds.first['index']['_index'])
646
650
  end
647
651
 
652
+ def test_writes_to_logstash_index_with_specified_prefix_and_separator
653
+ separator = '_'
654
+ driver.configure("logstash_format true
655
+ logstash_prefix_separator #{separator}
656
+ logstash_prefix myprefix")
657
+ time = Time.parse Date.today.to_s
658
+ logstash_index = "myprefix#{separator}#{time.getutc.strftime("%Y.%m.%d")}"
659
+ stub_elastic_ping
660
+ stub_elastic
661
+ driver.emit(sample_record, time.to_i)
662
+ driver.run
663
+ assert_equal(logstash_index, index_cmds.first['index']['_index'])
664
+ end
665
+
648
666
  def test_writes_to_logstash_index_with_specified_prefix_uppercase
649
667
  driver.configure("logstash_format true
650
668
  logstash_prefix MyPrefix")
@@ -739,7 +757,7 @@ class ElasticsearchOutput < Test::Unit::TestCase
739
757
  assert_equal(index_cmds[1]['@timestamp'], ts)
740
758
  assert_equal("logstash-2001.02.03", index_cmds[0]['index']['_index'])
741
759
  end
742
-
760
+
743
761
  def test_uses_custom_time_key_exclude_timekey
744
762
  driver.configure("logstash_format true
745
763
  time_key vtm
@@ -68,6 +68,10 @@ class ElasticsearchOutputDynamic < Test::Unit::TestCase
68
68
  assert_equal 'john', instance.user
69
69
  assert_equal 'doe', instance.password
70
70
  assert_equal '/es/', instance.path
71
+ assert_equal :TLSv1, instance.ssl_version
72
+ assert_nil instance.client_key
73
+ assert_nil instance.client_cert
74
+ assert_nil instance.client_key_pass
71
75
  end
72
76
 
73
77
  def test_defaults
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: 1.9.7
4
+ version: 1.10.0
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-09-13 00:00:00.000000000 Z
12
+ date: 2017-09-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fluentd
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: 0.10.43
20
+ version: 0.12.10
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: 0.10.43
27
+ version: 0.12.10
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: excon
30
30
  requirement: !ruby/object:Gem::Requirement