y-ken/fluent-plugin-rewrite-tag-filter — pull request #8 by futoase (2013-10-11 09:35:52+00:00)
Title: Support split of tag

**Add config_param of split_of_tag**

An proposal.
This difference is split tag, use of period.

```ruby
${tag} #== hoge.fuga.moge

${tag[0]} #== hoge
${tag[1]} #== fuga
${tag[2]} #== moge
```

**fluentd.conf(sample)**

```

type forward
port 24244

type rewrite_tag_filter
rewriterule1 server_type ^([a-z]+)$ ${tag[1]}.$1.${tag[2]}

type copy

type tdlog
api_key hogehogehogehogehogehoge

type file
path /var/log/fluentd/production_api.log

type copy

type mongo

type file
path /var/log/fluentd/staging_api.log

type file
path /var/log/fluentd/development_api.log

```

**command**

```
> echo '{"user_id": "10000", "name": "hogehoge", "server_type": "development", "description": "super user"}' | bundle ex fluent-cat app.game.peach
> echo '{"user_id": "10000", "name": "hogehoge", "server_type": "production", "description": "super user"}' | bundle ex fluent-cat app.game.mario
> echo '{"user_id": "10000", "name": "hogehoge", "server_type": "staging", "description": "super user"}' | bundle ex fluent-cat app.game.luigi
```

**result**

- production_api.log

```
2013-10-11T15:25:28+09:00 game.production.mario {"user_id":"10000","name":"hogehoge","server_type":"production","description":"super user"}
```

- staging_api.log

```
2013-10-11T15:25:48+09:00 game.staging.luigi {"user_id":"10000","name":"hogehoge","server_type":"staging","description":"super user"}
```

- development_api.log

```
2013-10-11T15:25:08+09:00 game.development.peach {"user_id":"10000","name":"hogehoge","server_type":"development","description":"super user"}
```