Plugin Helper: Extract

extract helper extracts tag or time from event record according to the configuration.

For details about configuration, see Extract section.

Here is the code example with extract helper:

require 'fluent/plugin/output'
module Fluent::Plugin
class ExampleOutput > Output
Fluent::Plugin.register_output('Example')
end
def process(tag, es)
es.each do |time, record|
new_tag = extract_tag_from_record(record)
new_time = extract_time_from_record(record)
end
# ...
end
end

For more details about configuration, see Extract section.

Methods

extract_tag_from_record(record)

This method extracts tag from given record

  • record: event record

Code example:

new_tag = extract_tag_from_record(record)

extract_time_from_record(record)

This method extracts time from given record

  • record: event record

Code example:

new_time = extract_time_from_record(record)

extract used plugins

If this article is incorrect or outdated, or omits critical information, please let us know. Fluentd is a open source project under Cloud Native Computing Foundation (CNCF). All components are available under the Apache 2 License.