fluent-plugin-elasticsearch 1.18.2 → 2.0.0.rc.1
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 +5 -5
- data/.gitignore +0 -1
- data/.travis.yml +0 -1
- data/History.md +4 -96
- data/README.md +23 -162
- data/fluent-plugin-elasticsearch.gemspec +5 -5
- data/lib/fluent/plugin/elasticsearch_index_template.rb +3 -8
- data/lib/fluent/plugin/out_elasticsearch.rb +314 -420
- data/lib/fluent/plugin/out_elasticsearch_dynamic.rb +206 -220
- data/test/plugin/test_out_elasticsearch.rb +303 -806
- data/test/plugin/test_out_elasticsearch_dynamic.rb +180 -257
- metadata +13 -24
- data/Gemfile.v0.12 +0 -11
- data/lib/fluent/log-ext.rb +0 -38
- data/lib/fluent/plugin/elasticsearch_constants.rb +0 -11
- data/lib/fluent/plugin/elasticsearch_error_handler.rb +0 -89
- data/lib/fluent/plugin/elasticsearch_simple_sniffer.rb +0 -10
- data/lib/fluent/plugin/filter_elasticsearch_genid.rb +0 -25
- data/test/plugin/test_elasticsearch_error_handler.rb +0 -264
- data/test/plugin/test_filter_elasticsearch_genid.rb +0 -40
- data/test/test_log-ext.rb +0 -33
@@ -1,40 +0,0 @@
|
|
1
|
-
require 'helper'
|
2
|
-
require 'date'
|
3
|
-
require 'json'
|
4
|
-
require 'flexmock/test_unit'
|
5
|
-
require 'fluent/plugin/filter_elasticsearch_genid'
|
6
|
-
|
7
|
-
class ElasticsearchGenidFilterTest < Test::Unit::TestCase
|
8
|
-
include FlexMock::TestCase
|
9
|
-
|
10
|
-
def setup
|
11
|
-
Fluent::Test.setup
|
12
|
-
end
|
13
|
-
|
14
|
-
def create_driver(conf='')
|
15
|
-
Fluent::Test::FilterTestDriver.new(Fluent::ElasticsearchGenidFilter).configure(conf)
|
16
|
-
end
|
17
|
-
|
18
|
-
def sample_record
|
19
|
-
{'age' => 26, 'request_id' => '42', 'parent_id' => 'parent', 'routing_id' => 'routing'}
|
20
|
-
end
|
21
|
-
|
22
|
-
def test_configure
|
23
|
-
d = create_driver
|
24
|
-
assert_equal '_hash', d.instance.hash_id_key
|
25
|
-
end
|
26
|
-
|
27
|
-
data("default" => {"hash_id_key" => "_hash"},
|
28
|
-
"custom_key" => {"hash_id_key" => "_edited"},
|
29
|
-
)
|
30
|
-
def test_filter(data)
|
31
|
-
d = create_driver("hash_id_key #{data["hash_id_key"]}")
|
32
|
-
flexmock(SecureRandom).should_receive(:uuid)
|
33
|
-
.and_return("13a0c028-bf7c-4ae2-ad03-ec09a40006df")
|
34
|
-
d.run do
|
35
|
-
d.filter(sample_record)
|
36
|
-
end
|
37
|
-
assert_equal(Base64.strict_encode64(SecureRandom.uuid),
|
38
|
-
d.filtered_as_array.map {|e| e.last}.first[d.instance.hash_id_key])
|
39
|
-
end
|
40
|
-
end
|
data/test/test_log-ext.rb
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
require 'helper'
|
2
|
-
require 'fluent/log-ext'
|
3
|
-
|
4
|
-
class TestFluentLogExtHandler < Test::Unit::TestCase
|
5
|
-
def setup
|
6
|
-
@log = Fluent::Test::TestLogger.new
|
7
|
-
@log.level = "info"
|
8
|
-
end
|
9
|
-
|
10
|
-
def test_trace?
|
11
|
-
assert_false @log.respond_to?(:trace?)
|
12
|
-
end
|
13
|
-
|
14
|
-
def test_debug?
|
15
|
-
assert_true @log.respond_to?(:debug?)
|
16
|
-
end
|
17
|
-
|
18
|
-
def test_info?
|
19
|
-
assert_true @log.respond_to?(:info?)
|
20
|
-
end
|
21
|
-
|
22
|
-
def test_warn?
|
23
|
-
assert_true @log.respond_to?(:warn?)
|
24
|
-
end
|
25
|
-
|
26
|
-
def test_error?
|
27
|
-
assert_true @log.respond_to?(:error?)
|
28
|
-
end
|
29
|
-
|
30
|
-
def test_fatal?
|
31
|
-
assert_true @log.respond_to?(:fatal?)
|
32
|
-
end
|
33
|
-
end
|