Plugin Helper: Inject
require 'fluent/plugin/filter'
module Fluent::Plugin
class ExampleFilter < Filter
Fluent::Plugin.register_filter('example', self)
# 1. Load inject helper
helpers :inject
# Omit `configure`, `shutdown` and other plugin APIs
def filter(tag, time, record)
# 2. Inject values into `record`
new_record = inject_values_to_record(tag, time, record)
# edit new_record ...
new_record
end
end
endMethods
inject_values_to_record(tag, time, record)
inject_values_to_record(tag, time, record)inject_values_to_event_stream(tag, es)
inject_values_to_event_stream(tag, es)Plugins using inject
injectLast updated
Was this helpful?