Permalink
Browse files

README: fixed README.md

Signed-off-by: OZAWA Tsuyoshi <ozawa.tsuyoshi@gmail.com>
  • Loading branch information...
1 parent 60429ad commit 6f94bece0114ddf8ca266793cee7bfe0648093f1 @oza committed Oct 31, 2011
Showing with 39 additions and 36 deletions.
  1. +39 −36 README.md
View
@@ -2,46 +2,49 @@ Zeromq plugin for Fluentd
=============
fluent-plugin-zmq provides an adaptor between fluentd and zeromq.
-Getting Started
-------
-1. setup the source
-> ZeroMQ input
-> <source>
-> type zmq
-> port 4444
-> </source>
+# Getting Started
+Setup the ZeroMQ input:
-2. Run a source code.
-> #!/usr/bin/env ruby
-> require 'zmq'
-> require 'msgpack'
->
-> z = ZMQ::Context.new
-> s = z.socket(ZMQ::DOWNSTREAM)
-> s.connect("tcp://127.0.0.1:4444")
-> tag = "debug.test"
-> # echo '{"json":"message"}' | fluent-cat debug.test
-> array = ["key" => "value"]
->
-> def write_impl(s, tag, array)
-> begin
-> s.send([tag, Time.now.to_s, array].to_msgpack)
-> rescue
-> $stderr.puts "write failed: #{$!}"
-> s.close
-> return false
-> end
->
-> return true
-> end
->
-> write_impl(s, tag, array)
-3. Happy logging with zeromq and fluetnd!
+~~~~~
+ <source>
+ type zmq
+ port 4444
+ </source>
+~~~~~
+Run a sample code.
+~~~~~
+ #!/usr/bin/env ruby
+ require 'zmq'
+ require 'msgpack'
+
+ z = ZMQ::Context.new
+ s = z.socket(ZMQ::DOWNSTREAM)
+ s.connect("tcp://127.0.0.1:4444")
+ tag = "debug.test"
+ # echo '{"json":"message"}' | fluent-cat debug.test
+ array = ["key" => "value"]
+
+ def write_impl(s, tag, array)
+ begin
+ s.send([tag, Time.now.to_s, array].to_msgpack)
+ rescue
+ $stderr.puts "write failed: #{$!}"
+ s.close
+ return false
+ end
+
+ return true
+ end
+
+ write_impl(s, tag, array)
+~~~~~
-TODO
-------
+That's done.
+Happy logging with zeromq and fluetnd! :)
+
+# TODO
- ZeroMQ output
- ZeroMQ forwarding
- JSON support

0 comments on commit 6f94bec

Please sign in to comment.