fluent-plugin-config_pit
fluentd を使って居て s3 プラグインなんかを使うときに各種APIキーなどを設定ファイルに書いたりするのが微妙な場合があるので、設定内で pit を使いたい。のでプラグインを作りました。
<match my.tag>
type config_pit
<pit aws>
type s3
...
aws_key_id $pit[aws_access_key]
aws_sec_key $pit[aws_secret_access_key]
...
</pit>
</match>こんな感じで設定してやると該当箇所を pit に保存されている値で置き換えます。pit aws の "aws" が pit の ID です。
- github : https://github.com/naoya/fluent-plugin-config_pit
- rubygems : https://rubygems.org/gems/fluent-plugin-config_pit
実装は、id:tagomoris さんの config-expander をパクら参考にさせていただきました。やっていることはとっても単純です。
ruby 力をもうちょっと鍛えないと、色々躓く箇所が多すぎる・・・!