Fluentd Output filter plugin. It has designed to rewrite tag like mod_rewrite. Re-emmit a record with rewrited tag when a value matches/unmatches with the regular expression. Also you can change a tag from apache log by domain, status-code(ex. 500 error), user-agent, request-uri, regex-backreference and so on with regular expression.
Gemfile gem 'fluent-plugin-rewrite-tag-filter', '~> 1.5.1'
install gem install fluent-plugin-rewrite-tag-filter