====== Fluentd ====== ===== インストールされているプラグイン一覧表示 ===== /opt/td-agent/embedded/bin/fluent-gem list ===== tagにホスト名を入れる ===== ==== e.g. ==== @type tail path /var/log/messages tag "td.log.messages.#{Socket.gethostname}" pos_file /var/log/messages.td.pos format syslog ==== その他 ==== record_transformer filter pluginを使う ===== Log受信に失敗する ===== error_class=MessagePack::MalformedFormatError error="invalid byte" tag="WebM04/dms.ssl_member_error_log" ”Specify time_as_integer true in your configuration of out_forward in v0.14. See "Sub-second time": http://www.fluentd.org/blog/fluentd-v0.14.0-has-been-released” 要約:適当 v0.12までは秒単位であったLogの時間分解能がv0.14からnano秒となりました。\\ このため、Fluentd v0.14から転送されたナノ秒の分解能を含むバイナリデータの受信にFluentd v0.12は失敗します。\\ Fluentd v0.14からFluent v0.12にデータを転送する場合、forward出力プラグインの設定でtime_as_integer true指定します。 ===== gem install pg が失敗する ===== 以下の手順で行けた(2019.11.08 @CentOS7) - yum install postgresql96-lib - yum install postgresql96 - yum install postgresql96-devel - yum install gcc - export PATH=/usr/pgsql-9.6/bin:$PATH ===== 参考 ===== * [[https://www.fluentd.org/guides/recipes/apache-add-hostname|Adding Hostname to Event Logs (Apache httpd Example)]] * [[https://www.ospn.jp/osc2014-nagoya/pdf/OSC2014_Nagoya_tis.pdf|ツールをちょい足ししてPostgreSQLの運用を楽にする]] * [[https://www.clear-code.com/blog/2018/2/27.html|Fluentd用のベンチマークツールを開発しました]]