前提・実現したいこと
バイナリファイル(psacct)のログをfluentdでログサーバに転送を行いたい。
tailプラグインで転送できそうだったので試してみたが、ログサーバ側で正常に表示ができない状態でして対処方法(プラグイン等)があればご教授いただけませんでしょうか。
元のメッセージ
# lastcomm | head -n 5 lastcomm X root pts/1 0.00 secs Wed Jan 30 08:01 less root pts/1 0.00 secs Wed Jan 30 08:01 crond SF root __ 0.00 secs Wed Jan 30 08:01 run-parts root __ 0.00 secs Wed Jan 30 08:01 logger root __ 0.00 secs Wed Jan 30 08:01
出力先のメッセージ
# lastcomm -f pacct.2019-01-30.log | head -n 5 15813181 [49,0] 1127.04 secs Thu Jan 1 05:03 15813836 __ 1131.52 secs Thu Jan 1 00:00 15811870 __ 1131.52 secs Thu Jan 1 00:00 ing 15812526 [68,0] 0.00 secs Thu Jan 1 05:02 ing 15799418 [68,0] 0.00 secs Thu Jan 1 05:02
サーバ側のtd-agent.conf
<source> @type tail path /var/account/pacct* pos_file /var/account.pos tag psacctlog format none </source> <match psacctlog> @type forward send_timeout 60s <server> host xxx.xxx.xxx.xxx port 24224 </server> </match>
logサーバ側のtd-agent.conf
<source> @type forward port 24224 bind 0.0.0.0 </source> <match psacctlog> @type file format single_value append true path /backup/pacct time_slice_format %Y-%m-%d <buffer> @type file path /backup/pacct.buffer flush_mode interval flush_interval 60s </buffer> </match>
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。