tagomoris/fluent-mixin-config-placeholders — pull request #3 by kenjiskywalker (2014-01-19 10:15:54+00:00)
Title: hostnameの値を取得するkeyに"hostname"という単語を利用できるようにする

`fluent-mixin-config-placeholders`を利用した`fluent-plugin-record-modifier`で

```
hostname ${hostname}
```

を利用しようとしたところ、ホスト名を取得するkeyに`hostname`という単語を使用すると
意図した結果にならなかったので、このpull-reqを送ります。
このpull-reqを反映すると`hostname`

```
hostname ${hostname}
```
は利用できるようになりますが、筋が悪いかもしれません。
ご確認いただけますでしょうか。

## fluentd.conf

```

type forward
port 24224

type copy

type stdout

type copy

type stdout

type record_modifier
hostname ${hostname}
tag modifiered

```

## 変更前

```
$ echo '{"message" : "hoge"}' | fluent-cat tagname
$ echo '{"message" : "hoge"}' | fluent-cat tagname.hoge
```

```
$ fluentd -c fluentd.conf2014-01-16 23:09:49 +0900 [info]: starting fluentd-0.10.40
2014-01-16 23:09:49 +0900 [info]: reading config file path="fluentd.conf"
2014-01-16 23:09:50 +0900 [info]: gem 'fluent-mixin-config-placeholders' version '0.2.3'
2014-01-16 23:09:50 +0900 [info]: gem 'fluent-plugin-forest' version '0.2.2'
2014-01-16 23:09:50 +0900 [info]: gem 'fluent-plugin-mongo' version '0.7.1'
2014-01-16 23:09:50 +0900 [info]: gem 'fluent-plugin-record-modifier' version '0.1.2'
2014-01-16 23:09:50 +0900 [info]: gem 'fluent-plugin-record-reformer' version '0.2.1'
2014-01-16 23:09:50 +0900 [info]: gem 'fluent-plugin-redshift' version '0.0.2'
2014-01-16 23:09:50 +0900 [info]: gem 'fluent-plugin-s3' version '0.3.4'
2014-01-16 23:09:50 +0900 [info]: gem 'fluentd' version '0.10.40'
2014-01-16 23:09:50 +0900 [info]: using configuration file:

type forward
port 24224

type copy

type stdout

type copy

type stdout

type record_modifier
hostname ${hostname}
tag modifiered

2014-01-16 23:09:50 +0900 [info]: adding source type="forward"
2014-01-16 23:09:50 +0900 [info]: adding match pattern="modifiered.**" type="copy"
2014-01-16 23:09:50 +0900 [info]: adding match pattern="**" type="copy"
2014-01-16 23:09:50 +0900 [info]: listening fluent socket on 0.0.0.0:24224
2014-01-16 23:09:54 +0900 tagname: {"message":"hoge"}
2014-01-16 23:09:54 +0900 modifiered: {"message":"hoge","hostname":"${hostname}"}
2014-01-16 23:09:57 +0900 tagname.hoge: {"message":"hoge"}
2014-01-16 23:09:57 +0900 modifiered: {"message":"hoge","hostname":"${hostname}"}
```

## 変更後

```
$ fluentd -c fluentd.conf
2014-01-16 23:06:17 +0900 [info]: starting fluentd-0.10.40
2014-01-16 23:06:17 +0900 [info]: reading config file path="fluentd.conf"
2014-01-16 23:06:17 +0900 [info]: gem 'fluent-mixin-config-placeholders' version '0.2.3'
2014-01-16 23:06:17 +0900 [info]: gem 'fluent-plugin-forest' version '0.2.2'
2014-01-16 23:06:17 +0900 [info]: gem 'fluent-plugin-mongo' version '0.7.1'
2014-01-16 23:06:17 +0900 [info]: gem 'fluent-plugin-record-modifier' version '0.1.2'
2014-01-16 23:06:17 +0900 [info]: gem 'fluent-plugin-record-reformer' version '0.2.1'
2014-01-16 23:06:17 +0900 [info]: gem 'fluent-plugin-redshift' version '0.0.2'
2014-01-16 23:06:17 +0900 [info]: gem 'fluent-plugin-s3' version '0.3.4'
2014-01-16 23:06:17 +0900 [info]: gem 'fluentd' version '0.10.40'
2014-01-16 23:06:17 +0900 [info]: using configuration file:

type forward
port 24224

type copy

type stdout

type copy

type stdout

type record_modifier
hostname ${hostname}
tag modifiered

2014-01-16 23:06:17 +0900 [info]: adding source type="forward"
2014-01-16 23:06:17 +0900 [info]: adding match pattern="modifiered.**" type="copy"
2014-01-16 23:06:17 +0900 [info]: adding match pattern="**" type="copy"
2014-01-16 23:06:17 +0900 [info]: listening fluent socket on 0.0.0.0:24224
2014-01-16 23:06:21 +0900 tagname: {"message":"hoge"}
2014-01-16 23:06:21 +0900 modifiered: {"message":"hoge","hostname":"testing.local"}
2014-01-16 23:06:54 +0900 tagname.hoge: {"message":"hoge"}
2014-01-16 23:06:54 +0900 modifiered: {"message":"hoge","hostname":"testing.local"}
```