Skip to content

Instantly share code, notes, and snippets.

@fujiwara

fujiwara/fluentd.conf

Last active Feb 7, 2020
Embed
What would you like to do?
fix fluentd tags from firelens
<match *-firelens-*>
@type firelens_tag_filter
</match>
<match app.firelens.**>
# ...
</match>
require "fluent/plugin/output"
class Fluent::Plugin::FirelensTagFilterOutput < Fluent::Plugin::Output
Fluent::Plugin.register_output('firelens_tag_filter', self)
helpers :event_emitter
def process(tag, es)
rewrited_tag = tag.gsub(/^(.*?)-firelens-(.*)/, '\1.firelens.\2')
router.emit_stream(rewrited_tag, es)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment