Versions | v1.0 (td-agent3)

Extract Plugin Helper API

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.

Table of Contents

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

Last updated: 2018-05-27 17:51:02 +0000

Versions | v1.0 (td-agent3)

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.