fluent-plugin-rewrite-tag-filter icon indicating copy to clipboard operation
fluent-plugin-rewrite-tag-filter copied to clipboard

Why can't I change back to the original tag?

Open xidiandb opened this issue 4 years ago • 4 comments

I want to keep the original tag, but I can't.

xidiandb avatar Aug 22 '19 06:08 xidiandb

Use record_transformer before apply this plugin.

okkez avatar Sep 05 '19 04:09 okkez

I'm new to fluentd but as far as I can tell, record_transformer isn't applicable when you want to rewrite some records based on tags but not all of them. For example, the below doesn't seem to work:

<match service.**>
  @type rewrite_tag_filter
  <rule>
    key     $.request.remote_address
    pattern /10\.[023]\.*/
    tag     ${tag}
  </rule>
  <rule>
    key     $.request.remote_address
    pattern /10\.6\.*/
    tag     region.${tag}
  </rule>
</match>

iJebus avatar Apr 12 '21 06:04 iJebus

I'm new to fluentd but as far as I can tell, record_transformer isn't applicable when you want to rewrite some records based on tags but not all of them. For example, the below doesn't seem to work:

Do you see why not,After the tag is modified, it will be rerouted, and the result will be returned to the logic of your modified tag

xidiandb avatar Apr 13 '21 03:04 xidiandb

Ah so it re-enters from the top? I had assumed it would be re-emitted from that match and continue down. Like I said, I'm new 😅 Anyway I understand now with your explanation, thank you!

iJebus avatar Apr 13 '21 03:04 iJebus