fluent-plugin-elasticsearch 2.10.1 → 2.10.2
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 +4 -4
- data/History.md +3 -0
- data/README.md +1 -1
- data/fluent-plugin-elasticsearch.gemspec +1 -1
- data/lib/fluent/plugin/out_elasticsearch_dynamic.rb +2 -2
- data/test/plugin/test_out_elasticsearch_dynamic.rb +15 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 17e838ba667a43b9522686a97dcf538954ea34492d8cad31336cc044b42196f7
|
|
4
|
+
data.tar.gz: c3b897eb2de3b7a230ab01a510b93b97890d44a6edc2477bd876a706838b94fb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 64b2e894d5f6b89368b6d4fe3ec4e1cc2285ffc567a3916768e674e56e7b7ff037e133dc771b1824e33ef4026d59f3138f4cce8b697fff2e0616a6eb5b05ad5c
|
|
7
|
+
data.tar.gz: 4288d08df20a953ecafa2ccc31d0c5a72b844c211a27e7f256b64e0fb300cc4934f1ee60c717df2a866f7b664bfe5f7a616426a6bc97150d161c15d7f7cfe52e
|
data/History.md
CHANGED
data/README.md
CHANGED
|
@@ -311,7 +311,7 @@ The path to the file containing the template to install.
|
|
|
311
311
|
Specify index templates in form of hash. Can contain multiple templates.
|
|
312
312
|
|
|
313
313
|
```
|
|
314
|
-
templates { "
|
|
314
|
+
templates { "template_name_1": "path_to_template_1_file", "template_name_2": "path_to_template_2_file"}
|
|
315
315
|
```
|
|
316
316
|
|
|
317
317
|
If `template_file` and `template_name` are set, then this parameter will be ignored.
|
|
@@ -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.10.
|
|
6
|
+
s.version = '2.10.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}
|
|
@@ -170,9 +170,9 @@ module Fluent::Plugin
|
|
|
170
170
|
|
|
171
171
|
if eval_or_val(dynamic_conf['logstash_format'])
|
|
172
172
|
if eval_or_val(dynamic_conf['utc_index'])
|
|
173
|
-
target_index = "#{dynamic_conf['logstash_prefix']}
|
|
173
|
+
target_index = "#{dynamic_conf['logstash_prefix']}#{@logstash_prefix_separator}#{Time.at(time).getutc.strftime("#{dynamic_conf['logstash_dateformat']}")}"
|
|
174
174
|
else
|
|
175
|
-
target_index = "#{dynamic_conf['logstash_prefix']}
|
|
175
|
+
target_index = "#{dynamic_conf['logstash_prefix']}#{@logstash_prefix_separator}#{Time.at(time).strftime("#{dynamic_conf['logstash_dateformat']}")}"
|
|
176
176
|
end
|
|
177
177
|
else
|
|
178
178
|
target_index = dynamic_conf['index_name']
|
|
@@ -426,6 +426,21 @@ class ElasticsearchOutputDynamic < Test::Unit::TestCase
|
|
|
426
426
|
assert_equal(logstash_index, index_cmds.first['index']['_index'])
|
|
427
427
|
end
|
|
428
428
|
|
|
429
|
+
def test_writes_to_logstash_index_with_specified_prefix_and_separator
|
|
430
|
+
separator = '_'
|
|
431
|
+
driver.configure("logstash_format true
|
|
432
|
+
logstash_prefix_separator #{separator}
|
|
433
|
+
logstash_prefix myprefix")
|
|
434
|
+
time = Time.parse Date.today.iso8601
|
|
435
|
+
logstash_index = "myprefix#{separator}#{time.getutc.strftime("%Y.%m.%d")}"
|
|
436
|
+
stub_elastic_ping
|
|
437
|
+
stub_elastic
|
|
438
|
+
driver.run(default_tag: 'test') do
|
|
439
|
+
driver.feed(time.to_i, sample_record)
|
|
440
|
+
end
|
|
441
|
+
assert_equal(logstash_index, index_cmds.first['index']['_index'])
|
|
442
|
+
end
|
|
443
|
+
|
|
429
444
|
def test_writes_to_logstash_index_with_specified_prefix_uppercase
|
|
430
445
|
driver.configure("logstash_format true
|
|
431
446
|
logstash_prefix MyPrefix")
|
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.10.
|
|
4
|
+
version: 2.10.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: 2018-
|
|
12
|
+
date: 2018-06-01 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: fluentd
|