fluent-plugin-td 0.10.28 → 0.10.29
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +18 -3
- data/ChangeLog +5 -0
- data/Gemfile.v0.12 +6 -0
- data/example.conf +12 -12
- data/lib/fluent/plugin/out_tdlog.rb +11 -6
- data/lib/fluent/plugin/td_plugin_version.rb +1 -1
- data/test/plugin/test_out_tdlog.rb +6 -8
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 910b18fb23795e9d27ff8ebeb6a382b61a5fe814
|
4
|
+
data.tar.gz: 71d77ea864bde3c88e35a077aaed26a338d0e530
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd18a7186e55f8fbd464382572a2b315886578661ca39bbcfdec63ebbe7a384beca2fb6287dc2870e66b469b9e47e7f7a293882bc41b98df74987e5f4abbbdf8
|
7
|
+
data.tar.gz: 80157c8f89bd3c5f8340a5c47b4674e454cd22a04274c1fb4e5bcba19090105f1dc73530c7c9f1a333aea764c0269c9dccb59c30dbcca2bf7c80f40b4cb0473d
|
data/.travis.yml
CHANGED
@@ -1,10 +1,25 @@
|
|
1
1
|
rvm:
|
2
2
|
- 1.9.3
|
3
|
-
- 2.0
|
4
|
-
- 2.1
|
3
|
+
- 2.0
|
4
|
+
- 2.1
|
5
|
+
- 2.2.4
|
6
|
+
- 2.3.1
|
7
|
+
- ruby-head
|
5
8
|
|
6
9
|
gemfile:
|
7
10
|
- Gemfile
|
8
|
-
- Gemfile.
|
11
|
+
- Gemfile.v0.12
|
9
12
|
|
13
|
+
before_install: gem update bundler
|
10
14
|
script: bundle exec rake test
|
15
|
+
|
16
|
+
sudo: false
|
17
|
+
|
18
|
+
matrix:
|
19
|
+
allow_failures:
|
20
|
+
- rvm: ruby-head
|
21
|
+
exclude:
|
22
|
+
- rvm: 1.9.3
|
23
|
+
gemfile: Gemfile
|
24
|
+
- rvm: 2.0
|
25
|
+
gemfile: Gemfile
|
data/ChangeLog
CHANGED
data/Gemfile.v0.12
ADDED
data/example.conf
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
# Treasure Data output
|
6
6
|
# match events whose tag is td.DATABASE.TABLE
|
7
7
|
<match td.*.*>
|
8
|
-
type tdlog
|
8
|
+
@type tdlog
|
9
9
|
apikey YOUR_API_KEY
|
10
10
|
|
11
11
|
auto_create_table
|
@@ -15,7 +15,7 @@
|
|
15
15
|
|
16
16
|
## match tag=debug.** and dump to console
|
17
17
|
<match debug.**>
|
18
|
-
type stdout
|
18
|
+
@type stdout
|
19
19
|
</match>
|
20
20
|
|
21
21
|
####
|
@@ -24,25 +24,25 @@
|
|
24
24
|
|
25
25
|
## built-in TCP input
|
26
26
|
<source>
|
27
|
-
type forward
|
27
|
+
@type forward
|
28
28
|
</source>
|
29
29
|
|
30
30
|
## built-in UNIX socket input
|
31
31
|
#<source>
|
32
|
-
# type unix
|
32
|
+
# @type unix
|
33
33
|
#</source>
|
34
34
|
|
35
35
|
# HTTP input
|
36
36
|
# POST http://localhost:8888/<tag>?json=<json>
|
37
37
|
# POST http://localhost:8888/td.myapp.login?json={"user"%3A"me"}
|
38
38
|
<source>
|
39
|
-
type http
|
39
|
+
@type http
|
40
40
|
port 8888
|
41
41
|
</source>
|
42
42
|
|
43
43
|
## live debugging agent
|
44
44
|
<source>
|
45
|
-
type debug_agent
|
45
|
+
@type debug_agent
|
46
46
|
bind 127.0.0.1
|
47
47
|
port 24230
|
48
48
|
</source>
|
@@ -54,7 +54,7 @@
|
|
54
54
|
## File input
|
55
55
|
## read apache logs continuously and tags td.apache.access
|
56
56
|
#<source>
|
57
|
-
# type tail
|
57
|
+
# @type tail
|
58
58
|
# format apache
|
59
59
|
# path /var/log/httpd-access.log
|
60
60
|
# tag td.apache.access
|
@@ -63,14 +63,14 @@
|
|
63
63
|
## File output
|
64
64
|
## match tag=local.** and write to file
|
65
65
|
#<match local.**>
|
66
|
-
# type file
|
66
|
+
# @type file
|
67
67
|
# path /var/log/td-agent/access
|
68
68
|
#</match>
|
69
69
|
|
70
70
|
## Forwarding
|
71
71
|
## match tag=system.** and forward to another td-agent server
|
72
72
|
#<match system.**>
|
73
|
-
# type forward
|
73
|
+
# @type forward
|
74
74
|
# host 192.168.0.11
|
75
75
|
# # secondary host is optional
|
76
76
|
# <secondary>
|
@@ -81,16 +81,16 @@
|
|
81
81
|
## Multiple output
|
82
82
|
## match tag=td.*.* and output to Treasure Data AND file
|
83
83
|
#<match td.*.*>
|
84
|
-
# type copy
|
84
|
+
# @type copy
|
85
85
|
# <store>
|
86
|
-
# type tdlog
|
86
|
+
# @type tdlog
|
87
87
|
# apikey API_KEY
|
88
88
|
# auto_create_table
|
89
89
|
# buffer_type file
|
90
90
|
# buffer_path /var/log/td-agent/buffer/td
|
91
91
|
# </store>
|
92
92
|
# <store>
|
93
|
-
# type file
|
93
|
+
# @type file
|
94
94
|
# path /var/log/td-agent/td-%Y-%m-%d/%H.log
|
95
95
|
# </store>
|
96
96
|
#</match>
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'td-client'
|
2
|
+
require 'fluent/output'
|
2
3
|
require 'fluent/plugin/td_plugin_version'
|
3
4
|
|
4
5
|
module Fluent
|
@@ -21,7 +22,6 @@ module Fluent
|
|
21
22
|
config_param :connect_timeout, :integer, :default => nil
|
22
23
|
config_param :read_timeout, :integer, :default => nil
|
23
24
|
config_param :send_timeout, :integer, :default => nil
|
24
|
-
config_set_default :buffer_type, 'file'
|
25
25
|
config_set_default :flush_interval, 300
|
26
26
|
|
27
27
|
def initialize
|
@@ -45,6 +45,16 @@ module Fluent
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def configure(conf)
|
48
|
+
# overwrite default value of buffer_chunk_limit
|
49
|
+
unless conf.has_key?('buffer_chunk_limit')
|
50
|
+
conf['buffer_chunk_limit'] = IMPORT_SIZE_LIMIT
|
51
|
+
end
|
52
|
+
|
53
|
+
# v0.14 seems to have a bug of config_set_default: https://github.com/treasure-data/fluent-plugin-td/pull/22#issuecomment-230782005
|
54
|
+
unless conf.has_key?('buffer_type')
|
55
|
+
conf['buffer_type'] = 'file'
|
56
|
+
end
|
57
|
+
|
48
58
|
super
|
49
59
|
|
50
60
|
if @use_gzip_command
|
@@ -57,11 +67,6 @@ module Fluent
|
|
57
67
|
end
|
58
68
|
end
|
59
69
|
|
60
|
-
# overwrite default value of buffer_chunk_limit
|
61
|
-
if !conf['buffer_chunk_limit']
|
62
|
-
@buffer.buffer_chunk_limit = IMPORT_SIZE_LIMIT
|
63
|
-
end
|
64
|
-
|
65
70
|
if conf.has_key?('tmpdir')
|
66
71
|
@tmpdir = conf['tmpdir']
|
67
72
|
FileUtils.mkdir_p(@tmpdir)
|
@@ -3,11 +3,6 @@ require 'fluent/plugin/out_tdlog'
|
|
3
3
|
require 'test_helper.rb'
|
4
4
|
|
5
5
|
class TreasureDataLogOutputTest < Test::Unit::TestCase
|
6
|
-
# BufferedOutputTestDriver uses module_eval, not inheritance.
|
7
|
-
# This DummyOutput is for testing actual write method with webmock
|
8
|
-
class TreasureDataLogDummyOutput < Fluent::TreasureDataLogOutput
|
9
|
-
end
|
10
|
-
|
11
6
|
def setup
|
12
7
|
Fluent::Test.setup
|
13
8
|
end
|
@@ -25,9 +20,12 @@ class TreasureDataLogOutputTest < Test::Unit::TestCase
|
|
25
20
|
buffer_path #{TMP_DIR}/buffer
|
26
21
|
] + conf
|
27
22
|
|
28
|
-
Fluent::Test::BufferedOutputTestDriver.new(
|
23
|
+
Fluent::Test::BufferedOutputTestDriver.new(Fluent::TreasureDataLogOutput) do
|
29
24
|
def write(chunk)
|
30
25
|
chunk.instance_variable_set(:@key, @key)
|
26
|
+
def chunk.key
|
27
|
+
@key
|
28
|
+
end
|
31
29
|
super(chunk)
|
32
30
|
end
|
33
31
|
end.configure(config)
|
@@ -51,7 +49,7 @@ class TreasureDataLogOutputTest < Test::Unit::TestCase
|
|
51
49
|
assert_rr {
|
52
50
|
# mock(d.instance).gzip_by_writer(is_a(Fluent::BufferChunk), is_a(Tempfile)) causes empty request body so using dont_allow instead to check calling method
|
53
51
|
# We need actual gzipped content to verify compressed body is correct or not.
|
54
|
-
dont_allow(d.instance).gzip_by_command(
|
52
|
+
dont_allow(d.instance).gzip_by_command(anything, is_a(Tempfile))
|
55
53
|
|
56
54
|
records.each { |record|
|
57
55
|
d.emit(record, time)
|
@@ -70,7 +68,7 @@ class TreasureDataLogOutputTest < Test::Unit::TestCase
|
|
70
68
|
stub_td_import_request(stub_request_body(records, time), database, table)
|
71
69
|
assert_rr {
|
72
70
|
# same as test_emit
|
73
|
-
dont_allow(d.instance).gzip_by_writer(
|
71
|
+
dont_allow(d.instance).gzip_by_writer(anything, is_a(Tempfile))
|
74
72
|
|
75
73
|
records.each { |record|
|
76
74
|
d.emit(record, time)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-td
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.29
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Treasure Data, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
@@ -112,6 +112,7 @@ files:
|
|
112
112
|
- ChangeLog
|
113
113
|
- Gemfile
|
114
114
|
- Gemfile.msgpack.0.4
|
115
|
+
- Gemfile.v0.12
|
115
116
|
- README.rdoc
|
116
117
|
- Rakefile
|
117
118
|
- example.conf
|
@@ -141,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
142
|
version: '0'
|
142
143
|
requirements: []
|
143
144
|
rubyforge_project:
|
144
|
-
rubygems_version: 2.
|
145
|
+
rubygems_version: 2.5.1
|
145
146
|
signing_key:
|
146
147
|
specification_version: 4
|
147
148
|
summary: Treasure Data Cloud Data Service plugin for Fluentd
|