{"id":686,"name":null,"description":"Fluentd Output filter plugin to rewrite tags that matches specified attribute.","url":"https://github.com/fluent/fluent-plugin-rewrite-tag-filter","last_synced_at":"2026-04-30T01:00:41.151Z","repository":{"id":3482288,"uuid":"4537790","full_name":"fluent/fluent-plugin-rewrite-tag-filter","owner":"fluent","description":"Fluentd Output filter plugin to rewrite tags that matches specified attribute.","archived":false,"fork":false,"pushed_at":"2026-04-02T01:07:13.000Z","size":577,"stargazers_count":170,"open_issues_count":23,"forks_count":64,"subscribers_count":17,"default_branch":"master","last_synced_at":"2026-04-28T13:11:36.973Z","etag":null,"topics":["fluentd","fluentd-plugin"],"latest_commit_sha":null,"homepage":"http://rubygems.org/gems/fluent-plugin-rewrite-tag-filter","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fluent.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2012-06-03T14:16:41.000Z","updated_at":"2026-04-02T01:07:15.000Z","dependencies_parsed_at":"2025-04-17T01:28:28.946Z","dependency_job_id":"927769a0-8781-414c-ad0b-6bdcb3716a57","html_url":"https://github.com/fluent/fluent-plugin-rewrite-tag-filter","commit_stats":{"total_commits":219,"total_committers":18,"mean_commits":"12.166666666666666","dds":0.4429223744292238,"last_synced_commit":"1851ed210e09f52a09473a3682965ef41b55578e"},"previous_names":["y-ken/fluent-plugin-rewrite-tag-filter"],"tags_count":37,"template":false,"template_full_name":null,"purl":"pkg:github/fluent/fluent-plugin-rewrite-tag-filter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluent%2Ffluent-plugin-rewrite-tag-filter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluent%2Ffluent-plugin-rewrite-tag-filter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluent%2Ffluent-plugin-rewrite-tag-filter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluent%2Ffluent-plugin-rewrite-tag-filter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fluent","download_url":"https://codeload.github.com/fluent/fluent-plugin-rewrite-tag-filter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluent%2Ffluent-plugin-rewrite-tag-filter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32450234,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"ssl_error","status_checked_at":"2026-04-29T22:10:49.234Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"owner":{"login":"fluent","name":"Fluentd: Unified Logging Layer","uuid":"859518","kind":"organization","description":"Fluentd is a cloud native logging solution to unify data collection and consumption.","email":null,"website":"http://www.fluentd.org/","location":"Cloud Native Computing Foundation","twitter":null,"company":null,"icon_url":"https://avatars.githubusercontent.com/u/859518?v=4","repositories_count":89,"last_synced_at":"2023-04-10T10:21:17.081Z","metadata":{"has_sponsors_listing":false},"html_url":"https://github.com/fluent","funding_links":[],"total_stars":null,"followers":null,"following":null,"created_at":"2022-11-02T16:44:11.958Z","updated_at":"2023-04-10T10:21:17.360Z","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fluent","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fluent/repositories"},"packages":[],"commits":{"id":295203,"full_name":"fluent/fluent-plugin-rewrite-tag-filter","default_branch":"master","total_commits":231,"total_committers":18,"total_bot_commits":1,"total_bot_committers":1,"mean_commits":12.833333333333334,"dds":0.4675324675324676,"past_year_total_commits":8,"past_year_total_committers":2,"past_year_total_bot_commits":1,"past_year_total_bot_committers":1,"past_year_mean_commits":4.0,"past_year_dds":0.125,"last_synced_at":"2026-04-29T02:19:04.670Z","last_synced_commit":"49ac1f1368e9523fa41cd9300b0e2ceabd5bf94d","created_at":"2023-03-08T16:22:46.452Z","updated_at":"2026-04-29T02:18:35.023Z","committers":[{"name":"y-ken","email":"y.ken.studio@gmail.com","login":"y-ken","count":123},{"name":"Kenji Okimoto","email":"okimoto@clear-code.com","login":"okkez","count":69},{"name":"Shizuo Fujita","email":"fujita@clear-code.com","login":"Watson1978","count":7},{"name":"futoase","email":"futoase@gmail.com","login":"futoase","count":6},{"name":"Masahiro Nakagawa","email":"repeatedly@gmail.com","login":"repeatedly","count":4},{"name":"Hiroshi Hatake","email":"hatake@clear-code.com","login":"cosmo0920","count":4},{"name":"Michael \"M3\" Lasevich","email":"Michael.Lasevich@bhnetwork.com","login":null,"count":3},{"name":"Daijiro Fukuda","email":"fukuda@clear-code.com","login":"daipom","count":2},{"name":"Kohei Suzuki","email":"eagletmt@gmail.com","login":"eagletmt","count":2},{"name":"kiyoto","email":"me@ktamura.com","login":"kiyoto","count":2},{"name":"Kentaro Hayashi","email":"hayashi@clear-code.com","login":"kenhys","count":2},{"name":"Koichi HARUNA","email":"koichi.h+github@gmail.com","login":"k-hal","count":1},{"name":"Yuzuki Masaru","email":"ephemeralsnow@gmail.com","login":"ephemeralsnow","count":1},{"name":"dependabot[bot]","email":"49699333+dependabot[bot]","login":"dependabot[bot]","count":1},{"name":"fwojciak","email":"fwojciak","login":"fwojciak","count":1},{"name":"koooge","email":"koooooge@gmail.com","login":"koooge","count":1},{"name":"Masahiro Yamauchi","email":"yamauchi@geishatokyo.com","login":null,"count":1},{"name":"ume","email":"bungoume3@yahoo.co.jp","login":"bungoume","count":1}],"past_year_committers":[{"name":"Shizuo Fujita","email":"fujita@clear-code.com","login":"Watson1978","count":7},{"name":"dependabot[bot]","email":"49699333+dependabot[bot]","login":"dependabot[bot]","count":1}],"commits_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluent%2Ffluent-plugin-rewrite-tag-filter/commits","host":{"name":"GitHub","url":"https://github.com","kind":"github","last_synced_at":"2026-04-30T00:00:07.427Z","repositories_count":6223374,"commits_count":899976217,"contributors_count":34898904,"owners_count":1147624,"icon_url":"https://github.com/github.png","host_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub/repositories"}},"issues_stats":{"full_name":"fluent/fluent-plugin-rewrite-tag-filter","html_url":"https://github.com/fluent/fluent-plugin-rewrite-tag-filter","last_synced_at":"2026-04-28T00:00:37.604Z","status":"error","issues_count":59,"pull_requests_count":54,"avg_time_to_close_issue":15712092.5,"avg_time_to_close_pull_request":3164067.75,"issues_closed_count":40,"pull_requests_closed_count":48,"pull_request_authors_count":16,"issue_authors_count":56,"avg_comments_per_issue":3.3389830508474576,"avg_comments_per_pull_request":1.777777777777778,"merged_pull_requests_count":46,"bot_issues_count":0,"bot_pull_requests_count":1,"past_year_issues_count":0,"past_year_pull_requests_count":6,"past_year_avg_time_to_close_issue":null,"past_year_avg_time_to_close_pull_request":4430.0,"past_year_issues_closed_count":0,"past_year_pull_requests_closed_count":5,"past_year_pull_request_authors_count":2,"past_year_issue_authors_count":0,"past_year_avg_comments_per_issue":null,"past_year_avg_comments_per_pull_request":0.0,"past_year_bot_issues_count":0,"past_year_bot_pull_requests_count":1,"past_year_merged_pull_requests_count":5,"created_at":"2023-05-12T10:59:18.975Z","updated_at":"2026-04-28T00:00:37.604Z","repository_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluent%2Ffluent-plugin-rewrite-tag-filter","issues_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluent%2Ffluent-plugin-rewrite-tag-filter/issues","issue_labels_count":{"enhancement":2},"pull_request_labels_count":{"github_actions":1,"dependencies":1},"issue_author_associations_count":{"NONE":54,"MEMBER":3,"CONTRIBUTOR":2},"pull_request_author_associations_count":{"CONTRIBUTOR":47,"MEMBER":4,"NONE":3},"issue_authors":{"y-ken":3,"ferbar":2,"k-hal":1,"devin-hpcnt-zz":1,"dimalbaby":1,"bryanlarsen":1,"lhucinequr":1,"jiamo":1,"bkupidura":1,"bilzard":1,"kasiprasad":1,"kezhiyang":1,"g3kr":1,"BrendanBall":1,"Nabilliban14":1,"quasipedia":1,"JoaquinSV":1,"jmglsn":1,"iwilltry42":1,"JohnMops":1,"pangxudong":1,"skYl1r":1,"mlasevich":1,"chenjienn":1,"gshively11":1,"thekantian":1,"Tesseract242":1,"trevex":1,"ethanlieske":1,"betazep":1,"sschroed99":1,"tumbl3w33d":1,"dshmatov":1,"Verhaeg":1,"jkawamoto":1,"GAHila":1,"u-shunya":1,"nhti":1,"tporeba":1,"moebiuseye":1,"okkez":1,"xidiandb":1,"vajahath":1,"flippyflap":1,"mirii1994":1,"bkannadassan":1,"harryge00":1,"martinhynar":1,"gmile":1,"syst0m":1,"Renz2018":1,"someword":1,"cognitiaclaeves":1,"nelson-ks":1,"Horkyze":1,"Mist3ry":1},"pull_request_authors":{"okkez":28,"Watson1978":5,"y-ken":3,"kenhys":3,"daipom":2,"cosmo0920":2,"eagletmt":2,"tungol":1,"repeatedly":1,"fwojciak":1,"peter-slovak":1,"k-hal":1,"dependabot[bot]":1,"mlasevich":1,"koooge":1,"bungoume":1},"host":{"name":"GitHub","url":"https://github.com","kind":"github","last_synced_at":"2026-04-29T00:00:10.439Z","repositories_count":14441624,"issues_count":34188159,"pull_requests_count":112285915,"authors_count":11248329,"icon_url":"https://github.com/github.png","host_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories","owners_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/owners","authors_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors"},"past_year_issue_labels_count":{},"past_year_pull_request_labels_count":{"dependencies":1,"github_actions":1},"past_year_issue_author_associations_count":{},"past_year_pull_request_author_associations_count":{"CONTRIBUTOR":6},"past_year_issue_authors":{},"past_year_pull_request_authors":{"Watson1978":5,"dependabot[bot]":1},"maintainers":[{"login":"y-ken","count":6,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/y-ken"},{"login":"repeatedly","count":1,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/repeatedly"}],"active_maintainers":[]},"events":{"total":{"DeleteEvent":2,"PullRequestEvent":6,"ForkEvent":1,"WatchEvent":2,"PushEvent":4,"PullRequestReviewEvent":3,"CreateEvent":1},"last_year":{"DeleteEvent":2,"PullRequestEvent":4,"WatchEvent":1,"PushEvent":3,"PullRequestReviewEvent":2,"CreateEvent":1}},"keywords":["fluentd","fluentd-plugin"],"dependencies":[{"ecosystem":"rubygems","filepath":"fluent-plugin-rewrite-tag-filter.gemspec","sha":null,"kind":"manifest","created_at":"2022-09-07T10:20:34.277Z","updated_at":"2022-09-07T10:20:34.277Z","repository_link":"https://github.com/fluent/fluent-plugin-rewrite-tag-filter/blob/master/fluent-plugin-rewrite-tag-filter.gemspec","dependencies":[{"id":4094923529,"package_name":"test-unit","ecosystem":"rubygems","requirements":"\u003e= 3.1.0","direct":true,"kind":"development","optional":false},{"id":4094923530,"package_name":"test-unit-rr","ecosystem":"rubygems","requirements":"\u003e= 0","direct":true,"kind":"development","optional":false},{"id":4094923531,"package_name":"rake","ecosystem":"rubygems","requirements":"\u003e= 0","direct":true,"kind":"development","optional":false},{"id":4094923532,"package_name":"fluentd","ecosystem":"rubygems","requirements":"\u003e= 0.14.2, \u003c 2","direct":true,"kind":"runtime","optional":false},{"id":4094923533,"package_name":"fluent-config-regexp-type","ecosystem":"rubygems","requirements":"\u003e= 0","direct":true,"kind":"runtime","optional":false}]},{"ecosystem":"actions","filepath":".github/workflows/linux.yml","sha":null,"kind":"manifest","created_at":"2024-06-18T13:52:30.317Z","updated_at":"2024-06-18T13:52:30.317Z","repository_link":"https://github.com/fluent/fluent-plugin-rewrite-tag-filter/blob/master/.github/workflows/linux.yml","dependencies":[{"id":18676980541,"package_name":"actions/checkout","ecosystem":"actions","requirements":"v3","direct":true,"kind":"composite","optional":false},{"id":18676980542,"package_name":"ruby/setup-ruby","ecosystem":"actions","requirements":"v1","direct":true,"kind":"composite","optional":false}]},{"ecosystem":"actions","filepath":".github/workflows/macos.yml","sha":null,"kind":"manifest","created_at":"2024-06-18T13:52:30.722Z","updated_at":"2024-06-18T13:52:30.722Z","repository_link":"https://github.com/fluent/fluent-plugin-rewrite-tag-filter/blob/master/.github/workflows/macos.yml","dependencies":[{"id":18676980574,"package_name":"actions/checkout","ecosystem":"actions","requirements":"v3","direct":true,"kind":"composite","optional":false},{"id":18676980575,"package_name":"ruby/setup-ruby","ecosystem":"actions","requirements":"v1","direct":true,"kind":"composite","optional":false}]},{"ecosystem":"actions","filepath":".github/workflows/windows.yml","sha":null,"kind":"manifest","created_at":"2024-06-18T13:52:31.118Z","updated_at":"2024-06-18T13:52:31.118Z","repository_link":"https://github.com/fluent/fluent-plugin-rewrite-tag-filter/blob/master/.github/workflows/windows.yml","dependencies":[{"id":18676980603,"package_name":"actions/checkout","ecosystem":"actions","requirements":"v3","direct":true,"kind":"composite","optional":false},{"id":18676980604,"package_name":"ruby/setup-ruby","ecosystem":"actions","requirements":"v1","direct":true,"kind":"composite","optional":false}]},{"ecosystem":"rubygems","filepath":"Gemfile","sha":null,"kind":"manifest","created_at":"2024-06-18T13:52:31.532Z","updated_at":"2024-06-18T13:52:31.532Z","repository_link":"https://github.com/fluent/fluent-plugin-rewrite-tag-filter/blob/master/Gemfile","dependencies":[]}],"score":8.15306194680105,"created_at":"2024-12-15T21:38:08.720Z","updated_at":"2026-04-30T01:00:41.153Z","avatar_url":"https://github.com/fluent.png","language":"Ruby","monthly_downloads":0,"readme":"# fluent-plugin-rewrite-tag-filter [![Build Status](https://travis-ci.org/fluent/fluent-plugin-rewrite-tag-filter.png?branch=master)](https://travis-ci.org/fluent/fluent-plugin-rewrite-tag-filter)\n\n## Overview\n\nRewrite Tag Filter for [Fluentd](http://fluentd.org). It is designed to rewrite tags like mod_rewrite.  \nRe-emit the record with rewritten tag when a value matches/unmatches with a regular expression.  \nAlso you can change a tag from Apache log by domain, status code (ex. 500 error),  \nuser-agent, request-uri, regex-backreference and so on with regular expression.\n\nThis is an output plugin because fluentd's `filter` doesn't allow tag rewrite.\n\n## Requirements\n\n| fluent-plugin-rewrite-tag-filter | Fluentd    | Ruby   |\n|----------------------------------|------------|--------|\n| \u003e= 2.0.0                         | \u003e= v0.14.2 | \u003e= 2.1 |\n| \u003c 2.0.0                          | \u003e= v0.12.0 | \u003e= 1.9 |\n\n## Installation\n\nInstall with `gem` or `td-agent-gem` command as:\n\n```\n# for system installed fluentd\n$ gem install fluent-plugin-rewrite-tag-filter\n\n# for td-agent2 (with fluentd v0.12)\n$ sudo td-agent-gem install fluent-plugin-rewrite-tag-filter -v 1.6.0\n\n# for td-agent3 (with fluentd v0.14)\n$ sudo td-agent-gem install fluent-plugin-rewrite-tag-filter\n```\n\nFor more details, see [Plugin Management](https://docs.fluentd.org/deployment/plugin-management)\n\n## Configuration\n\n* **rewriterule\\\u003cnum\\\u003e** (string) (optional) \\\u003cattribute\\\u003e \\\u003cregex_pattern\\\u003e \\\u003cnew_tag\\\u003e\n  * Obsoleted: Use \\\u003crule\\\u003e section\n* **capitalize_regex_backreference** (bool) (optional): Capitalize letter for every matched regex backreference. (ex: maps -\u003e Maps) for more details, see usage.\n  * Default value: no\n* **remove_tag_prefix** (string) (optional): Remove tag prefix for tag placeholder. (see the section of \"Tag placeholder\")\n* **hostname_command** (string) (optional): Override hostname command for placeholder. (see the section of \"Tag placeholder\")\n  * Default value: `hostname`\n* **emit_mode** (enum) (required): Specify emit_mode to `batch` or `record`. `batch` will emit events per rewritten tag, and decrease IO. `record` will emit events per record.\n  * Default value: `batch`\n\n### \\\u003crule\\\u003e section (optional) (multiple)\n\n* **key** (string) (required): The field name to which the regular expression is applied\n* **pattern** (regexp) (required): The regular expression.\n  `/regexp/` is preferred because `/regexp/` style can support character classes such as `/[a-z]/`.\n  The pattern without slashes will cause errors if you use patterns start with character classes.\n* **tag** (string) (required): New tag\n* **label** (string) (optional): New label. If specified, label can be changed per-rule.\n* **invert** (bool) (optional): If true, rewrite tag when unmatch pattern\n  * Default value: `false`\n\n### Usage\n\nIt's a sample to exclude some static file log before split tag by domain.\n\n```\n\u003csource\u003e\n  @type tail\n  path /var/log/httpd/access_log\n  format apache2\n  time_format %d/%b/%Y:%H:%M:%S %z\n  tag td.apache.access\n  pos_file /var/log/td-agent/apache_access.pos\n\u003c/source\u003e\n\n# \"capitalize_regex_backreference yes\" affects converting every matched first letter of backreference to upper case. ex: maps -\u003e Maps\n# At 2nd \u003crule\u003e, redirect to tag named \"clear\" which unmatched for status code 200.\n# At 3rd \u003crule\u003e, redirect to tag named \"clear\" which is not end with \".com\"\n# At 6th \u003crule\u003e, \"site.$2$1\" to be \"site.ExampleMail\" by capitalize_regex_backreference option.\n\u003cmatch td.apache.access\u003e\n  @type rewrite_tag_filter\n  capitalize_regex_backreference yes\n  \u003crule\u003e\n    key     path\n    pattern /\\.(gif|jpe?g|png|pdf|zip)$/\n    tag clear\n  \u003c/rule\u003e\n  \u003crule\u003e\n    key     status\n    pattern /^200$/\n    tag     clear\n    invert  true\n  \u003c/rule\u003e\n  \u003crule\u003e\n    key     domain\n    pattern /^.+\\.com$/\n    tag     clear\n    invert  true\n  \u003c/rule\u003e\n  \u003crule\u003e\n    key     domain\n    pattern /^maps\\.example\\.com$/\n    tag     site.ExampleMaps\n  \u003c/rule\u003e\n  \u003crule\u003e\n    key     domain\n    pattern /^news\\.example\\.com$/\n    tag     site.ExampleNews\n  \u003c/rule\u003e\n  \u003crule\u003e\n    key     domain\n    pattern /^(mail)\\.(example)\\.com$/\n    tag     site.$2$1\n  \u003c/rule\u003e\n  # Note: Specify catch-all rule in the last block not to lost unmatched records\n  \u003crule\u003e\n    key     domain\n    pattern /.+/\n    tag     site.unmatched\n  \u003c/rule\u003e\n\u003c/match\u003e\n\n\u003cmatch site.*\u003e\n  @type mongo\n  host localhost\n  database apache_access\n  remove_tag_prefix site\n  tag_mapped\n  capped\n  capped_size 100m\n\u003c/match\u003e\n\n\u003cmatch clear\u003e\n  @type null\n\u003c/match\u003e\n```\n\n### Result\n\n```\n$ mongo\nMongoDB shell version: 2.2.0\n\u003e use apache_access\nswitched to db apache_access\n\u003e show collections\nExampleMaps\nExampleNews\nExampleMail\nunmatched\n```\n\n### Debug\n\nOn starting td-agent, Logging supported like below.\n\n```\n$ tailf /var/log/td-agent/td-agent.log\n2012-09-16 18:10:51 +0900: adding match pattern=\"td.apache.access\" type=\"rewrite_tag_filter\"\n2012-09-16 18:10:51 +0900: adding rewrite_tag_filter rule: [1, \"path\", /\\.(gif|jpe?g|png|pdf|zip)$/, \"clear\"]\n2012-09-16 18:10:51 +0900: adding rewrite_tag_filter rule: [2, \"domain\", /^maps\\.example\\.com$/, \"site.ExampleMaps\"]\n2012-09-16 18:10:51 +0900: adding rewrite_tag_filter rule: [3, \"domain\", /^news\\.example\\.com$/, \"site.ExampleNews\"]\n2012-09-16 18:10:51 +0900: adding rewrite_tag_filter rule: [4, \"domain\", /^(mail)\\.(example)\\.com$/, \"site.$2$1\"]\n2012-09-16 18:10:51 +0900: adding rewrite_tag_filter rule: [5, \"domain\", /.+/, \"site.unmatched\"]\n```\n\n### Nested attributes\n\nDot notation:\n\n```\n\u003cmatch kubernetes.**\u003e\n  @type rewrite_tag_filter\n  \u003crule\u003e\n    key $.kubernetes.namespace_name\n    pattern ^(.+)$\n    tag $1.${tag}\n  \u003c/rule\u003e\n\u003c/match\u003e\n```\n\nBracket notation:\n\n```\n\u003cmatch kubernetes.**\u003e\n  @type rewrite_tag_filter\n  \u003crule\u003e\n    key $['kubernetes']['namespace_name']\n    pattern ^(.+)$\n    tag $1.${tag}\n  \u003c/rule\u003e\n\u003c/match\u003e\n```\n\nThese example configurations can process nested attributes like following:\n\n```\n{\n  \"kubernetes\": {\n    \"namespace_name\": \"default\"\n  }\n}\n```\n\nWhen original tag is `kubernetes.var.log`, this will be converted to `default.kubernetes.var.log`.\n\n### Tag placeholder\n\nIt is supported these placeholder for new_tag (rewritten tag).\n\n- `${tag}`\n- `__TAG__`\n- `${tag_parts[n]}`\n- `__TAG_PARTS[n]__`\n- `${hostname}`\n- `__HOSTNAME__`\n\nThe placeholder of `${tag_parts[n]}` and `__TAG_PARTS[n]__` acts accessing the index which split the tag with \".\" (dot).  \nFor example with `td.apache.access` tag, it will get `td` by `${tag_parts[0]}` and `apache` by `${tag_parts[1]}`.\n\n**Note** Currently, range expression ```${tag_parts[0..2]}``` is not supported.\n\n#### Placeholder Options\n\n* `remove_tag_prefix`  \n\nThis option adds removing tag prefix for `${tag}` or `__TAG__` in placeholder.\n\n* `remove_tag_regexp`  \n\nThis option adds removing tag regexp for `${tag}` or `__TAG__` in placeholder.\n\n* `hostname_command` \n\nBy default, execute command as `hostname` to get full hostname.  \nOn your needs, it could override hostname command using `hostname_command` option.  \nIt comes short hostname with `hostname_command hostname -s` configuration specified.\n\n#### Placeholder Usage\n\nIt's a sample to rewrite a tag with placeholder.\n\n```\n# It will get \"rewritten.access.ExampleMail\"\n\u003cmatch apache.access\u003e\n  @type rewrite_tag_filter\n  remove_tag_prefix apache\n  \u003crule\u003e\n    key     domain\n    pattern ^(mail)\\.(example)\\.com$\n    tag     rewritten.${tag}.$2$1\n  \u003c/rule\u003e\n\u003c/match\u003e\n\n# It will get \"rewritten.access.ExampleMail\"\n\u003cmatch apache.access\u003e\n  @type rewrite_tag_filter\n  remove_tag_regexp /^apache\\./\n  \u003crule\u003e\n    key     domain\n    pattern ^(mail)\\.(example)\\.com$\n    tag     rewritten.${tag}.$2$1\n  \u003c/rule\u003e\n\u003c/match\u003e\n\n# It will get \"http.access.log\"\n\u003cmatch input.{apache,nginx}.access.log\u003e\n  @type rewrite_tag_filter\n  remove_tag_regexp /^input\\.(apache|nginx)\\./\n  \u003crule\u003e\n    key     domain\n    pattern ^.+$\n    tag     http.${tag}\n  \u003c/rule\u003e\n\u003c/match\u003e\n\n# It will get \"rewritten.ExampleMail.app30-124.foo.com\" when hostname is \"app30-124.foo.com\"\n\u003cmatch apache.access\u003e\n  @type rewrite_tag_filter\n  \u003crule\u003e\n    key     domain\n    pattern ^(mail)\\.(example)\\.com$\n    tag     rewritten.$2$1.${hostname}\n  \u003c/rule\u003e\n\u003c/match\u003e\n\n# It will get \"rewritten.ExampleMail.app30-124\" when hostname is \"app30-124.foo.com\"\n\u003cmatch apache.access\u003e\n  @type rewrite_tag_filter\n  hostname_command hostname -s\n  \u003crule\u003e\n    key     domain\n    pattern ^(mail)\\.(example)\\.com$\n    tag     rewritten.$2$1.${hostname}\n  \u003c/rule\u003e\n\u003c/match\u003e\n\n# It will get \"rewritten.game.pool\"\n\u003cmatch app.game.pool.activity\u003e\n  @type rewrite_tag_filter\n  \u003crule\u003e\n    key     domain\n    pattern ^.+$\n    tag     rewritten.${tag_parts[1]}.${tag_parts[2]}\n  \u003c/rule\u003e\n\u003c/match\u003e\n```\n\n### Altering Labels\n\nIn addition to changing tags, you can also change event's route by setting\n the label for the re-emitted event.\n\nFor example, given this configuration:\n\n```\n\u003cmatch apache.access\u003e\n  @type rewrite_tag_filter\n  \u003crule\u003e\n    key     domain\n    pattern ^www\\.example\\.com$\n    tag     web.${tag}\n  \u003c/rule\u003e\n  \u003crule\u003e\n    key     domain\n    pattern ^(.*)\\.example\\.com$\n    tag     other.$1\n    label   other\n  \u003c/rule\u003e\n\u003c/match\u003e\n```\n\nmessage: `{\"domain\": \"www.example.com\"}` will get its tag changed to \n`web.apache.access`, while message \n`{\"domain\": \"api.example.com\"}` will get its tag changed to `other.api` and\n be sent to label `other`\n\n## Example\n\n- Example1: how to analyze response_time, response_code and user_agent for each virtual domain websites.  \nhttps://github.com/y-ken/fluent-plugin-rewrite-tag-filter/blob/master/example.conf\n\n- Example2: how to exclude specified patterns before analyze response_time for each virtual domain websites.  \nhttps://github.com/y-ken/fluent-plugin-rewrite-tag-filter/blob/master/example2.conf\n\n## Related Articles\n\n- 自在にタグを書き換える fluent-plugin-rewrite-tag-filter でログ解析が捗るお話 #fluentd\u003cbr\u003e\nhttp://d.hatena.ne.jp/yoshi-ken/20120701/1341137269\n\n- Fluentd \u0026 TreasureDataで こっそり始めるログ集計 Fluentd Meetup #2 @mikeda\u003cbr\u003e\nhttp://www.slideshare.net/baguzy/fluentd-meetup-2-14073930\n\n- 似てる #fluentd プラグインの比較\u003cbr\u003e\nhttp://matsumana.wordpress.com/2012/11/15/%E4%BC%BC%E3%81%A6%E3%82%8B-fluentd-%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3%E3%81%AE%E6%AF%94%E8%BC%83/\n\n- Fluentdの集約サーバ用設定ファイル (fluent-plugin-rewrite-tag-filter版)\u003cbr\u003e\nhttps://gist.github.com/matsumana/4078096\n\n- 稼働中のFluentdにflowcounter pluginを導入してみた\u003cbr\u003e\nhttp://dayafterneet.blogspot.jp/2012/12/fluentdflowcounter-plugin.html\n\n- fluent-plugin-rewrite-tag-filter v1.2.0 をリリースしました。新機能であるremove_tag_prefix設定の使い方を解説します。 #fluentd\u003cbr\u003e\nhttp://y-ken.hatenablog.com/entry/fluent-plugin-rewrite-tag-filter-v1.2.0\n\n- fluent-plugin-rewrite-tag-filter v1.2.1 をリリースしました。設定サンプルと共にプレースホルダ機能強化内容を紹介します。 #fluentd\u003cbr\u003e\nhttp://y-ken.hatenablog.com/entry/fluent-plugin-rewrite-tag-filter-v1.2.1\n\n- 待望の正規表現の否定パターンに対応した fluent-plugin-rewrite-tag-filter v1.3.0 をリリースしました #fluentd\u003cbr\u003e\nhttp://y-ken.hatenablog.com/entry/fluent-plugin-rewrite-tag-filter-v1.3.0\n\n- 不具合修正版 fluent-plugin-rewrite-tag-filter v1.3.1 をリリースしました #fluentd\u003cbr\u003e\nhttp://y-ken.hatenablog.com/entry/fluent-plugin-rewrite-tag-filter-v1.3.1\n\n- PostgreSQLのログをfluentdで回収する設定 — still deeper\u003cbr\u003e\nhttp://chopl.in/blog/2013/06/07/postgresql_csv_log_with_fluentd.html\n\n- S3とFluentdを用いた効率的なログ管理 | SmartNews開発者ブログ\u003cbr\u003e\nhttps://developer.smartnews.com/blog/2013/09/02/an-effective-log-management-technique-which-uses-fluentd-and-s3/\n\n- fluentd(td-agent) の導入 : Raccoon Tech Blog [株式会社ラクーン 技術戦略部ブログ]\u003cbr\u003e\nhttp://techblog.raccoon.ne.jp/archives/35031163.html\n\n- fluent-plugin-rewrite-tag-filter v1.4.1 をリリースしました #fluentd\u003cbr\u003e\nhttp://y-ken.hatenablog.com/entry/fluent-plugin-rewrite-tag-filter-v1.4.1\n\n## TODO\n\nPull requests are very welcome!!\n\n## Copyright\n\nCopyright :  Copyright (c) 2012- Kentaro Yoshida (@yoshi_ken)  \nLicense   :  Apache License, Version 2.0\n\n","funding_links":[],"readme_doi_urls":[],"works":{},"citation_counts":{},"total_citations":0,"keywords_from_contributors":["cncf","data-collector","msgpack","crash-reporting","rubygems","ruby-gem","activerecord","marshaller","feature-flag"],"project_url":"https://ruby.ecosyste.ms/api/v1/projects/686","html_url":"https://ruby.ecosyste.ms/projects/686"}