fluent-plugin-elasticsearch 2.0.0.rc.1 → 2.0.0.rc.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.md +3 -0
- data/README.md +21 -0
- data/fluent-plugin-elasticsearch.gemspec +1 -1
- data/lib/fluent/plugin/out_elasticsearch.rb +6 -0
- data/test/plugin/test_out_elasticsearch.rb +26 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c2133b6bd8b8961cb98cf10e6de22c9b86d6b17
|
4
|
+
data.tar.gz: 797ad2184b49f1a3fa508df533dd82d300a10af8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc690dfb2d06e658c3cd14f9efac8f37c07f97de7420624ac3e358c79c4dda5a492dbd0bd055edd8bb4ed10a4ff2f7defedf81811e8cdeb9d47502e110f10ffb
|
7
|
+
data.tar.gz: 04a4eb3bed694306c50b1b8c7b257ab83142d5049de10e4c7fe931371bf6b3024be7ef6a7580c47fcb009420430456792180e3deb4a3c5ffc2773916de0a0c9e
|
data/History.md
CHANGED
data/README.md
CHANGED
@@ -22,6 +22,7 @@ Current maintainers: @cosmo0920
|
|
22
22
|
+ [logstash_format](#logstash_format)
|
23
23
|
+ [logstash_prefix](#logstash_prefix)
|
24
24
|
+ [logstash_dateformat](#logstash_dateformat)
|
25
|
+
+ [pipeline](#pipeline)
|
25
26
|
+ [time_key_format](#time_key_format)
|
26
27
|
+ [time_precision](#time_precision)
|
27
28
|
+ [time_key](#time_key)
|
@@ -56,6 +57,16 @@ Current maintainers: @cosmo0920
|
|
56
57
|
* [Contributing](#contributing)
|
57
58
|
* [Running tests](#running-tests)
|
58
59
|
|
60
|
+
## Requirements
|
61
|
+
|
62
|
+
| fluent-plugin-elasticsearch | fluentd | ruby |
|
63
|
+
|-------------------|---------|------|
|
64
|
+
| >= 2.0.0 | >= v0.14.0 | >= 2.1 |
|
65
|
+
| < 2.0.0 | >= v0.12.0 | >= 1.9 |
|
66
|
+
|
67
|
+
NOTE: fluent-plugin-elasticsearch v2.0.0 is now RC. We will release stable v2.0.0 soon.
|
68
|
+
NOTE: For v0.12 version, you should use 1.x.y version. Please send patch into v0.12 branch if you encountered 1.x version's bug.
|
69
|
+
|
59
70
|
## Installation
|
60
71
|
|
61
72
|
```sh
|
@@ -131,6 +142,16 @@ The strftime format to generate index target index name when `logstash_format` i
|
|
131
142
|
logstash_dateformat %Y.%m. # defaults to "%Y.%m.%d"
|
132
143
|
```
|
133
144
|
|
145
|
+
### pipeline
|
146
|
+
|
147
|
+
Only in ES >= 5.x is available to use this parameter.
|
148
|
+
This param is to set a pipeline id of your elasticsearch to be added into the request, you can configure ingest node.
|
149
|
+
For more information: [![Ingest node](https://www.elastic.co/guide/en/elasticsearch/reference/master/ingest.html)]
|
150
|
+
|
151
|
+
```
|
152
|
+
pipeline pipeline_id
|
153
|
+
```
|
154
|
+
|
134
155
|
### time_key_format
|
135
156
|
|
136
157
|
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 = '2.0.0.rc.
|
6
|
+
s.version = '2.0.0.rc.2'
|
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}
|
@@ -66,6 +66,8 @@ module Fluent::Plugin
|
|
66
66
|
config_param :tag_key, :string, :default => 'tag'
|
67
67
|
config_param :time_parse_error_tag, :string, :default => 'Fluent::ElasticsearchOutput::TimeParser.error'
|
68
68
|
config_param :reconnect_on_error, :bool, :default => false
|
69
|
+
config_param :pipeline, :string, :default => nil
|
70
|
+
|
69
71
|
|
70
72
|
config_section :buffer do
|
71
73
|
config_set_default :@type, DEFAULT_BUFFER_TYPE
|
@@ -343,6 +345,10 @@ module Fluent::Plugin
|
|
343
345
|
meta["_index".freeze] = target_index
|
344
346
|
meta["_type".freeze] = target_type
|
345
347
|
|
348
|
+
if @pipeline
|
349
|
+
meta["pipeline".freeze] = @pipeline
|
350
|
+
end
|
351
|
+
|
346
352
|
@meta_config_map.each do |record_key, meta_key|
|
347
353
|
meta[meta_key] = record[record_key] if record[record_key]
|
348
354
|
end
|
@@ -439,6 +439,17 @@ class ElasticsearchOutput < Test::Unit::TestCase
|
|
439
439
|
assert_equal('local-override', index_cmds.first['index']['_index'])
|
440
440
|
end
|
441
441
|
|
442
|
+
def test_writes_to_default_index_with_pipeline
|
443
|
+
pipeline = "fluentd"
|
444
|
+
driver.configure("pipeline #{pipeline}")
|
445
|
+
stub_elastic_ping
|
446
|
+
stub_elastic
|
447
|
+
driver.run(default_tag: 'test') do
|
448
|
+
driver.feed(sample_record)
|
449
|
+
end
|
450
|
+
assert_equal(pipeline, index_cmds.first['index']['pipeline'])
|
451
|
+
end
|
452
|
+
|
442
453
|
def test_writes_to_target_index_key_fallack
|
443
454
|
driver.configure("target_index_key @target_index\n")
|
444
455
|
stub_elastic_ping
|
@@ -793,6 +804,21 @@ class ElasticsearchOutput < Test::Unit::TestCase
|
|
793
804
|
assert_equal(index_cmds[1]['@timestamp'], ts)
|
794
805
|
end
|
795
806
|
|
807
|
+
def test_uses_custom_time_key_with_format
|
808
|
+
driver.configure("logstash_format true
|
809
|
+
time_key_format %Y-%m-%d %H:%M:%S.%N%z
|
810
|
+
time_key vtm\n")
|
811
|
+
stub_elastic_ping
|
812
|
+
stub_elastic
|
813
|
+
ts = "2001-02-03 13:14:01.673+02:00"
|
814
|
+
driver.run(default_tag: 'test') do
|
815
|
+
driver.feed(sample_record.merge!('vtm' => ts))
|
816
|
+
end
|
817
|
+
assert(index_cmds[1].has_key? '@timestamp')
|
818
|
+
assert_equal(index_cmds[1]['@timestamp'], ts)
|
819
|
+
assert_equal("logstash-2001.02.03", index_cmds[0]['index']['_index'])
|
820
|
+
end
|
821
|
+
|
796
822
|
def test_uses_custom_time_key_exclude_timekey
|
797
823
|
driver.configure("logstash_format true
|
798
824
|
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: 2.0.0.rc.
|
4
|
+
version: 2.0.0.rc.2
|
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-
|
12
|
+
date: 2017-09-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fluentd
|