fluent-plugin-zmq 0.0.1 → 0.0.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.
- data/AUTHORS +2 -0
- data/COPYING +14 -0
- data/Gemfile +1 -0
- data/README.md +48 -0
- data/lib/fluent-plugin-zmq/version.rb +1 -1
- data/lib/fluent/plugin/in_zmq.rb +5 -4
- metadata +5 -3
- data/README +0 -3
data/AUTHORS
ADDED
data/COPYING
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
Copyright (C) 2011 OZAWA Tsuyoshi
|
2
|
+
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
you may not use this file except in compliance with the License.
|
5
|
+
You may obtain a copy of the License at
|
6
|
+
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
See the License for the specific language governing permissions and
|
13
|
+
limitations under the License.
|
14
|
+
|
data/Gemfile
CHANGED
data/README.md
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
Zeromq plugin for Fluentd
|
2
|
+
=============
|
3
|
+
fluent-plugin-zmq provides an adaptor between fluentd and zeromq.
|
4
|
+
|
5
|
+
Getting Started
|
6
|
+
------
|
7
|
+
1. setup the source
|
8
|
+
> ZeroMQ input
|
9
|
+
> <source>
|
10
|
+
> type zmq
|
11
|
+
> port 4444
|
12
|
+
> </source>
|
13
|
+
|
14
|
+
2. Run a source code.
|
15
|
+
> #!/usr/bin/env ruby
|
16
|
+
> require 'zmq'
|
17
|
+
> require 'msgpack'
|
18
|
+
>
|
19
|
+
> z = ZMQ::Context.new
|
20
|
+
> s = z.socket(ZMQ::DOWNSTREAM)
|
21
|
+
> s.connect("tcp://127.0.0.1:4444")
|
22
|
+
> tag = "debug.test"
|
23
|
+
> # echo '{"json":"message"}' | fluent-cat debug.test
|
24
|
+
> array = ["key" => "value"]
|
25
|
+
>
|
26
|
+
> def write_impl(s, tag, array)
|
27
|
+
> begin
|
28
|
+
> s.send([tag, Time.now.to_s, array].to_msgpack)
|
29
|
+
> rescue
|
30
|
+
> $stderr.puts "write failed: #{$!}"
|
31
|
+
> s.close
|
32
|
+
> return false
|
33
|
+
> end
|
34
|
+
>
|
35
|
+
> return true
|
36
|
+
> end
|
37
|
+
>
|
38
|
+
> write_impl(s, tag, array)
|
39
|
+
3. Happy logging with zeromq and fluetnd!
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
TODO
|
44
|
+
------
|
45
|
+
- ZeroMQ output
|
46
|
+
- ZeroMQ forwarding
|
47
|
+
- JSON support
|
48
|
+
|
data/lib/fluent/plugin/in_zmq.rb
CHANGED
@@ -41,7 +41,7 @@ class ZMQInput < Input
|
|
41
41
|
|
42
42
|
def start
|
43
43
|
Signal.trap(:INT){
|
44
|
-
|
44
|
+
$log.error "SIGINT occured. shutdown..."
|
45
45
|
@server.close
|
46
46
|
exit(0)
|
47
47
|
}
|
@@ -96,9 +96,10 @@ class ZMQInput < Input
|
|
96
96
|
time = Engine.now if time == 0
|
97
97
|
record = msg[2]
|
98
98
|
|
99
|
-
|
100
|
-
p
|
101
|
-
p
|
99
|
+
# for debugging
|
100
|
+
#p tag
|
101
|
+
#p time
|
102
|
+
#p record
|
102
103
|
|
103
104
|
Engine.emit(tag, time, record)
|
104
105
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-zmq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-10-
|
12
|
+
date: 2011-10-31 00:00:00.000000000Z
|
13
13
|
dependencies: []
|
14
14
|
description: zmq plugin for fluent, an event collector
|
15
15
|
email:
|
@@ -19,8 +19,10 @@ extensions: []
|
|
19
19
|
extra_rdoc_files: []
|
20
20
|
files:
|
21
21
|
- .gitignore
|
22
|
+
- AUTHORS
|
23
|
+
- COPYING
|
22
24
|
- Gemfile
|
23
|
-
- README
|
25
|
+
- README.md
|
24
26
|
- Rakefile
|
25
27
|
- fluent-plugin-zmq.gemspec
|
26
28
|
- lib/fluent-plugin-zmq/version.rb
|
data/README
DELETED