Fluentd
Search…
Plugin Helper: Extract
The extract plugin helper extracts tag or time from the event record according to the configuration.
Here is an example:
1
require 'fluent/plugin/output'
2
3
module Fluent::Plugin
4
class ExampleOutput > Output
5
Fluent::Plugin.register_output('Example')
6
7
def process(tag, es)
8
es.each do |time, record|
9
new_tag = extract_tag_from_record(record)
10
new_time = extract_time_from_record(record)
11
end
12
# ...
13
end
14
end
Copied!
For more details, see Extract section.

Methods

extract_tag_from_record(record)

This method extracts tag from the given record.
    record: event record
Example:
1
new_tag = extract_tag_from_record(record)
Copied!

extract_time_from_record(record)

This method extracts time from the given record.
    record: event record
Example:
1
new_time = extract_time_from_record(record)
Copied!

Plugins using extract

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