Sha256: 5a8adae816dc13c3e00ce47506cc309659ed9d684f1ebe0d0ce1819394f7f6a7

Contents?: true

Size: 528 Bytes

Versions: 1

Compression:

Stored size: 528 Bytes

Contents

require 'fluent/plugin/output'
require 'event_services_pb'

module Fluent::Plugin
  class GrpcOutput < Output

    Fluent::Plugin.register_output('grpc', self)

    desc 'The endpoint of gRPC server.'
    config_param :path, :string

    def start
      super
      @stub = Event::Forwarder::Stub.new(@path, :this_channel_is_insecure)
    end

    def write(chunk)
      chunk.each do |time, record|
        ack = @stub.forward(Event::Log.new(name: record['message']))
        $stdout.puts ack.type
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fluent-plugin-grpc-0.0.2 lib/fluent/plugin/out_grpc.rb