Skip to content

Instantly share code, notes, and snippets.

Last active February 7, 2020 13:00
What would you like to do?
fix fluentd tags from firelens
<match *-firelens-*>
@type firelens_tag_filter
<match app.firelens.**>
# ...
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment