lib/fluent/plugin/out_azureeventhubs_buffered.rb in sk-fluent-plugin-azureeventhubs-0.0.11 vs lib/fluent/plugin/out_azureeventhubs_buffered.rb in sk-fluent-plugin-azureeventhubs-0.0.12
- old
+ new
@@ -1,9 +1,8 @@
-require 'thread'
-require 'fluent/output'
+module Fluent::Plugin
-class AzureEventHubsOutputBuffered < Fluent::BufferedOutput
+ class AzureEventHubsOutputBuffered < Output
Fluent::Plugin.register_output('azureeventhubs_buffered', self)
helpers :compat_parameters, :inject
DEFAULT_BUFFER_TYPE = "memory"
@@ -42,21 +41,23 @@
def format(tag, time, record)
record = inject_values_to_record(tag, time, record)
[tag, time, record].to_msgpack
end
- unless method_defined?(:log)
- define_method("log") { $log }
- end
-
-
-
def formatted_to_msgpack_binary?
true
end
def write(chunk)
chunk.msgpack_each { |tag, time, record|
+
+ if @include_tag
+ record['tag'] = tag
+ end
+ if @include_time
+ record[@tag_time_name] = time
+ end
@sender.send_w_properties(record, @message_properties)
}
end
- end
+ end
+end
\ No newline at end of file