fluent-plugin-scribe 0.10.4 → 0.10.5
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +9 -0
- data/README.rdoc +14 -0
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/fluent/plugin/in_scribe.rb +20 -2
- data/lib/fluent/plugin/out_scribe.rb +3 -13
- metadata +8 -10
data/ChangeLog
CHANGED
data/README.rdoc
CHANGED
@@ -43,13 +43,27 @@ Please add the following configurations to fluent.conf.
|
|
43
43
|
port 1463
|
44
44
|
</source>
|
45
45
|
|
46
|
+
# Scribe output
|
47
|
+
<match *>
|
48
|
+
type scribe
|
49
|
+
host scribed-host.local
|
50
|
+
port 1463
|
51
|
+
</match>
|
52
|
+
|
46
53
|
These options are supported.
|
47
54
|
|
55
|
+
* (for input)
|
48
56
|
* port: port number (default: 1463)
|
49
57
|
* bind: bind address (default: 0.0.0.0)
|
50
58
|
* server_type: server architecture either in 'simple', 'threaded', 'thread_pool', 'nonblocking' (default: nonblocking)
|
51
59
|
* is_framed: use framed protocol or not (default: true)
|
52
60
|
|
61
|
+
* (for output)
|
62
|
+
* host: host name or address (default: localhost)
|
63
|
+
* port: port number (default: 1463)
|
64
|
+
* field_ref: field name which sent as scribe log message (default: message)
|
65
|
+
* timeout: thrift protocol timeout (default: 30)
|
66
|
+
|
53
67
|
== For Developers
|
54
68
|
|
55
69
|
To test this plugin, please execute the following command in your 'fluent' project directory, not scribe input plugin directory.
|
data/Rakefile
CHANGED
@@ -12,7 +12,7 @@ begin
|
|
12
12
|
gemspec.homepage = "https://github.com/fluent/fluent-plugin-scribe"
|
13
13
|
gemspec.has_rdoc = false
|
14
14
|
gemspec.require_paths = ["lib"]
|
15
|
-
gemspec.add_dependency "fluentd", "~> 0.10.
|
15
|
+
gemspec.add_dependency "fluentd", "~> 0.10.7"
|
16
16
|
gemspec.add_dependency "thrift", "~> 0.7.0"
|
17
17
|
gemspec.test_files = Dir["test/**/*.rb"]
|
18
18
|
gemspec.files = Dir["bin/**/*", "lib/**/*", "test/**/*.rb"] +
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.10.
|
1
|
+
0.10.5
|
@@ -20,6 +20,8 @@ module Fluent
|
|
20
20
|
class ScribeInput < Input
|
21
21
|
Plugin.register_input('scribe', self)
|
22
22
|
|
23
|
+
include DetachMultiProcessMixin
|
24
|
+
|
23
25
|
config_param :port, :integer, :default => 1463
|
24
26
|
config_param :bind, :string, :default => '0.0.0.0'
|
25
27
|
config_param :server_type, :string, :default => 'nonblocking'
|
@@ -80,7 +82,16 @@ class ScribeInput < Input
|
|
80
82
|
else
|
81
83
|
raise ConfigError, "in_scribe: unsupported server_type '#{@server_type}'"
|
82
84
|
end
|
83
|
-
|
85
|
+
|
86
|
+
if @detach_process
|
87
|
+
@transport.listen
|
88
|
+
def @transport.listen
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
detach_multi_process do
|
93
|
+
@thread = Thread.new(&method(:run))
|
94
|
+
end
|
84
95
|
end
|
85
96
|
|
86
97
|
def shutdown
|
@@ -98,11 +109,18 @@ class ScribeInput < Input
|
|
98
109
|
class FluentScribeHandler
|
99
110
|
def Log(msgs)
|
100
111
|
begin
|
112
|
+
tags = {}
|
113
|
+
now = Engine.now
|
101
114
|
msgs.each { |msg|
|
115
|
+
tag = msg.category
|
102
116
|
record = {
|
103
117
|
'message' => msg.message.force_encoding('UTF-8')
|
104
118
|
}
|
105
|
-
|
119
|
+
es = (tags[tag] ||= MultiEventStream.new)
|
120
|
+
es.add(now, record)
|
121
|
+
}
|
122
|
+
tags.each_pair { |tag, es|
|
123
|
+
Engine.emit_stream(tag, es)
|
106
124
|
}
|
107
125
|
return ResultCode::OK
|
108
126
|
rescue => e
|
@@ -17,7 +17,7 @@
|
|
17
17
|
#
|
18
18
|
module Fluent
|
19
19
|
|
20
|
-
class ScribeOutput <
|
20
|
+
class ScribeOutput < ObjectBufferedOutput
|
21
21
|
Fluent::Plugin.register_output('scribe', self)
|
22
22
|
|
23
23
|
config_param :host, :string, :default => 'localhost'
|
@@ -49,16 +49,7 @@ class ScribeOutput < BufferedOutput
|
|
49
49
|
super
|
50
50
|
end
|
51
51
|
|
52
|
-
def
|
53
|
-
[tag, record].to_msgpack
|
54
|
-
end
|
55
|
-
|
56
|
-
def write(chunk)
|
57
|
-
records = []
|
58
|
-
chunk.msgpack_each { |arr|
|
59
|
-
records << arr
|
60
|
-
}
|
61
|
-
|
52
|
+
def write_objects(tag, es)
|
62
53
|
socket = Thrift::Socket.new @host, @port, @timeout
|
63
54
|
transport = Thrift::FramedTransport.new socket
|
64
55
|
protocol = Thrift::BinaryProtocol.new transport, false, false
|
@@ -67,8 +58,7 @@ class ScribeOutput < BufferedOutput
|
|
67
58
|
transport.open
|
68
59
|
begin
|
69
60
|
entries = []
|
70
|
-
|
71
|
-
tag, record = r
|
61
|
+
es.each { |time,record|
|
72
62
|
next unless record.has_key?(@field_ref)
|
73
63
|
entry = LogEntry.new
|
74
64
|
entry.category = tag
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-scribe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,23 +9,22 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-11-
|
13
|
-
default_executable: fluent-scribe-remote
|
12
|
+
date: 2011-11-16 00:00:00.000000000Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: fluentd
|
17
|
-
requirement: &
|
16
|
+
requirement: &15568620 !ruby/object:Gem::Requirement
|
18
17
|
none: false
|
19
18
|
requirements:
|
20
19
|
- - ~>
|
21
20
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.10.
|
21
|
+
version: 0.10.7
|
23
22
|
type: :runtime
|
24
23
|
prerelease: false
|
25
|
-
version_requirements: *
|
24
|
+
version_requirements: *15568620
|
26
25
|
- !ruby/object:Gem::Dependency
|
27
26
|
name: thrift
|
28
|
-
requirement: &
|
27
|
+
requirement: &15567980 !ruby/object:Gem::Requirement
|
29
28
|
none: false
|
30
29
|
requirements:
|
31
30
|
- - ~>
|
@@ -33,7 +32,7 @@ dependencies:
|
|
33
32
|
version: 0.7.0
|
34
33
|
type: :runtime
|
35
34
|
prerelease: false
|
36
|
-
version_requirements: *
|
35
|
+
version_requirements: *15567980
|
37
36
|
description:
|
38
37
|
email: kazuki.ohta@gmail.com
|
39
38
|
executables:
|
@@ -62,7 +61,6 @@ files:
|
|
62
61
|
- test/plugin/in_scribe.rb
|
63
62
|
- ChangeLog
|
64
63
|
- README.rdoc
|
65
|
-
has_rdoc: true
|
66
64
|
homepage: https://github.com/fluent/fluent-plugin-scribe
|
67
65
|
licenses: []
|
68
66
|
post_install_message:
|
@@ -83,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
81
|
version: '0'
|
84
82
|
requirements: []
|
85
83
|
rubyforge_project:
|
86
|
-
rubygems_version: 1.
|
84
|
+
rubygems_version: 1.8.10
|
87
85
|
signing_key:
|
88
86
|
specification_version: 3
|
89
87
|
summary: Scribe Input/Output plugin for Fluent event collector
|