Last active
February 7, 2020 13:00
-
-
Save fujiwara/360f6587e4e6ce082e2f9c1f67c873f3 to your computer and use it in GitHub Desktop.
fix fluentd tags from firelens
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<match *-firelens-*> | |
@type firelens_tag_filter | |
</match> | |
<match app.firelens.**> | |
# ... | |
</match> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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