-
-
Save dmreiland/c786fe02d21ec9d98dee to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'fluent-logger' | |
| # specify the host and port to forward data to | |
| logger = Fluent::Logger.new(nil, :host => "localhost", :port => 24224) | |
| fn = ARGV[0] | |
| fh = File.new(fn) | |
| msgpack_unpacker = MessagePack::Unpacker.new(fh) | |
| begin | |
| msgpack_unpacker.each do |time, record| | |
| # post data with the tag "t" | |
| logger.post_with_time('t', record, time) | |
| end | |
| ensure | |
| fh.close | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment