fluent-plugin-elasticsearch 1.9.5 → 1.9.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8af381642b4168628152b2baf959f30d85ecb3aa
4
- data.tar.gz: 64f4f74cf949f999db949489a59ea264d524b41e
3
+ metadata.gz: d696775b6819b452db82ff73075b683f582be7b8
4
+ data.tar.gz: 36f83a83adeb5faad0c3844749995b4893464304
5
5
  SHA512:
6
- metadata.gz: 3b1da6085fb920f79bf1fd1951da9aa00fea43ad78cf1dc48febb51973cc075e6d6339b050254cd5f8eb5e08c5ec77db2ced1140abd0c3e918aeced9f560a7fb
7
- data.tar.gz: e8701fbad7986ddb9be19659a6d27d79b180b5ec25ca95384bd888af0edef5e3b9ea112ad82fd905f7dab6da2992006dda3234caf3875bacea6f5eab3ef81bee
6
+ metadata.gz: 33961582ffb9cda14ef7d0e9d594c9a500b3dd421c816211b6e9522f66d8eda969c7f3f9c7f89e335022d91d452e3d9a975ca5fdb9e4a964c6c59d6e8021d77d
7
+ data.tar.gz: 2b13ac54761a25e4c9b74d479238afa2e1a8ecb6241224cd74bc0ebdbeef8c10b7150448a5aa8b4c5f85fdb06df719061960f1b7d2d31bae17d54562334e9122
data/History.md CHANGED
@@ -4,6 +4,9 @@
4
4
  - Log ES response errors (#230)
5
5
  - Use latest elasticsearch-ruby (#240)
6
6
 
7
+ ### 1.9.6
8
+ - add pipeline parameter (#266)
9
+
7
10
  ### 1.9.5
8
11
  - sub-second time precision [(#249)](https://github.com/uken/fluent-plugin-elasticsearch/pull/249)
9
12
 
data/README.md CHANGED
@@ -20,6 +20,7 @@ Note: For Amazon Elasticsearch Service please consider using [fluent-plugin-aws-
20
20
  + [logstash_format](#logstash_format)
21
21
  + [logstash_prefix](#logstash_prefix)
22
22
  + [logstash_dateformat](#logstash_dateformat)
23
+ + [pipeline](#pipeline)
23
24
  + [time_key_format](#time_key_format)
24
25
  + [time_precision](#time_precision)
25
26
  + [time_key](#time_key)
@@ -129,6 +130,16 @@ The strftime format to generate index target index name when `logstash_format` i
129
130
  logstash_dateformat %Y.%m. # defaults to "%Y.%m.%d"
130
131
  ```
131
132
 
133
+ ### pipeline
134
+
135
+ Only in ES >= 5.x is available to use this parameter.
136
+ This param is to set a pipeline id of your elasticsearch to be added into the request, you can configure ingest node.
137
+ For more information: [![Ingest node](https://www.elastic.co/guide/en/elasticsearch/reference/master/ingest.html)]
138
+
139
+ ```
140
+ pipeline pipeline_id
141
+ ```
142
+
132
143
  ### time_key_format
133
144
 
134
145
  The format of the time stamp field (`@timestamp` or what you specify with [time_key](#time_key)). This parameter only has an effect when [logstash_format](#logstash_format) is true as it only affects the name of the index we write to. Please see [Time#strftime](http://ruby-doc.org/core-1.9.3/Time.html#method-i-strftime) for information about the value of this format.
@@ -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.5'
6
+ s.version = '1.9.6'
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}
@@ -61,6 +61,7 @@ class Fluent::ElasticsearchOutput < Fluent::ObjectBufferedOutput
61
61
  config_param :tag_key, :string, :default => 'tag'
62
62
  config_param :time_parse_error_tag, :string, :default => 'Fluent::ElasticsearchOutput::TimeParser.error'
63
63
  config_param :reconnect_on_error, :bool, :default => false
64
+ config_param :pipeline, :string, :default => nil
64
65
 
65
66
  include Fluent::ElasticsearchIndexTemplate
66
67
 
@@ -327,6 +328,10 @@ class Fluent::ElasticsearchOutput < Fluent::ObjectBufferedOutput
327
328
  meta["_index".freeze] = target_index
328
329
  meta["_type".freeze] = target_type
329
330
 
331
+ if @pipeline
332
+ meta["pipeline".freeze] = @pipeline
333
+ end
334
+
330
335
  @meta_config_map.each do |record_key, meta_key|
331
336
  meta[meta_key] = record[record_key] if record[record_key]
332
337
  end
@@ -407,6 +407,16 @@ class ElasticsearchOutput < Test::Unit::TestCase
407
407
  assert_equal('local-override', index_cmds.first['index']['_index'])
408
408
  end
409
409
 
410
+ def test_writes_to_default_index_with_pipeline
411
+ pipeline = "fluentd"
412
+ driver.configure("pipeline #{pipeline}")
413
+ stub_elastic_ping
414
+ stub_elastic
415
+ driver.emit(sample_record)
416
+ driver.run
417
+ assert_equal(pipeline, index_cmds.first['index']['pipeline'])
418
+ end
419
+
410
420
  def test_writes_to_target_index_key_fallack
411
421
  driver.configure("target_index_key @target_index\n")
412
422
  stub_elastic_ping
@@ -716,6 +726,20 @@ class ElasticsearchOutput < Test::Unit::TestCase
716
726
  assert_equal(index_cmds[1]['@timestamp'], ts)
717
727
  end
718
728
 
729
+ def test_uses_custom_time_key_with_format
730
+ driver.configure("logstash_format true
731
+ time_key_format %Y-%m-%d %H:%M:%S.%N%z
732
+ time_key vtm\n")
733
+ stub_elastic_ping
734
+ stub_elastic
735
+ ts = "2001-02-03 13:14:01.673+02:00"
736
+ driver.emit(sample_record.merge!('vtm' => ts))
737
+ driver.run
738
+ assert(index_cmds[1].has_key? '@timestamp')
739
+ assert_equal(index_cmds[1]['@timestamp'], ts)
740
+ assert_equal("logstash-2001.02.03", index_cmds[0]['index']['_index'])
741
+ end
742
+
719
743
  def test_uses_custom_time_key_exclude_timekey
720
744
  driver.configure("logstash_format true
721
745
  time_key vtm
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.5
4
+ version: 1.9.6
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-05-11 00:00:00.000000000 Z
12
+ date: 2017-09-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fluentd
@@ -157,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
157
157
  version: '0'
158
158
  requirements: []
159
159
  rubyforge_project:
160
- rubygems_version: 2.5.1
160
+ rubygems_version: 2.6.11
161
161
  signing_key:
162
162
  specification_version: 4
163
163
  summary: ElasticSearch output plugin for Fluent event collector