ja:documentation:pandorafms:technical_annexes:rsyslog-audit-forwarding

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
ja:documentation:pandorafms:technical_annexes:rsyslog-audit-forwarding [2026/07/18 22:31] – [Review Rsyslog journals] junichija:documentation:pandorafms:technical_annexes:rsyslog-audit-forwarding [2026/07/18 22:39] (現在) – [Operational review list] junichi
行 344: 行 344:
 <wrap #ks6_4 /> <wrap #ks6_4 />
  
-==== Common issues and solutions ====+==== よくある問題と解決策 ====
  
 ^Symptom  ^Root cause  ^Solution  ^ ^Symptom  ^Root cause  ^Solution  ^
行 353: 行 353:
 |New audit lines arrive with a delay.|''imfile'' does //polling// every 10 seconds by default.| Lower that value with ''PollingInterval="2"'' in the ''imfile'' input if near-//real-time// is needed.| |New audit lines arrive with a delay.|''imfile'' does //polling// every 10 seconds by default.| Lower that value with ''PollingInterval="2"'' in the ''imfile'' input if near-//real-time// is needed.|
 |After a sender restart, the last seconds of auditing are lost| The memory queue is discarded upon shutdown.|''queue.saveonshutdown="on"'' (specified in the [[#ks6_3|Rsyslog journals review]]) persists the queue to disk; upon startup, Rsyslog empties it.| |After a sender restart, the last seconds of auditing are lost| The memory queue is discarded upon shutdown.|''queue.saveonshutdown="on"'' (specified in the [[#ks6_3|Rsyslog journals review]]) persists the queue to disk; upon startup, Rsyslog empties it.|
 +
 +^症状 ^根本原因 ^解決策 ^
 +|受信側が空のままで、送信側のログに ''remote server closed connection'' と記録される。|受信側の設定に //解析 (parsing)// エラーがある。//リスナー (listener)// は動作しているが、メッセージがデフォルトの //ルールセット (ruleset)// によって破棄されている。|受信側で ''rsyslogd -N1'' を実行し、設定を修正する。Rsyslog 8.2510 以降では、''omfile'' 内で ''template='' ではなく ''dynaFile='' を使用する。|
 +|受信側のファイルは存在するが、監査ログだけでなく ''CROND'' や ''rsyslogd'' などのログも含まれている。|送信側の //設定 (config)// のルートレベルで ''omfwd'' アクションが宣言されており、//メインルールセット (main ruleset)// からのすべてのメッセージが転送されている。|''omfwd'' アクションを専用の //ルールセット (ruleset)// で囲み、''ruleset="..."'' を使用して ''imfile'' 入力をそのルールセットにリンクさせる。|
 +|送信側で ''parameter 'queue.maxdisksize' not known'' というエラーが出る。|そのパラメータは ''queue.type="disk"'' の場合にのみ有効であり、''linkedList'' では無効である。|''queue.maxdisksize'' を削除するか、キューを ''disk'' に変更する。|
 +|''/var/lib/rsyslog/imfile-state*'' を削除した後、過去のデータが転送されない。|期待される動作: //状態ファイル (state file)// がない場合、''imfile'' はファイルの現在の末尾を起点とし、新しい行のみを送信する。|//状態ファイル (state file)// はそのままにしておく。**過去のデータを転送するには**、''imfile'' 入力で ''readMode="2"'' を使用する。|
 +|新しい監査ログの行が遅れて到着する。|''imfile'' はデフォルトで 10 秒ごとに //ポーリング (polling)// を行う。|ほぼ //リアルタイム (real-time)// の処理が必要な場合は、''imfile'' 入力で ''PollingInterval="2"'' を指定してその値を小さくする。|
 +|送信側を再起動した後、最後の数秒間の監査ログが失われる。|シャットダウン時にメモリキューが破棄されるため。|''queue.saveonshutdown="on"''([[#ks6_3|Rsyslog ジャーナルの確認]] で指定)を設定すると、キューがディスクに保存される(起動時に Rsyslog がそれを処理して空にする)。|
  
 <wrap #ks6_5 /> <wrap #ks6_5 />
-==== Re-anchoring the sender ====+ 
 +==== 送信側のアンカー再設定 ====
  
 To rebuild the audit //stream// from scratch (for example, after a long offline period for the receiver where the local audit //log// has fallen behind), reset the ''imfile'' //state// and confirm that the file still exists in the expected path: To rebuild the audit //stream// from scratch (for example, after a long offline period for the receiver where the local audit //log// has fallen behind), reset the ''imfile'' //state// and confirm that the file still exists in the expected path:
 +
 +監査ストリームをゼロから再構築する場合(例えば、受信側が長期間オフラインになり、ローカルの監査ログの処理が遅延してしまった後など)、''imfile'' の状態(state)をリセットし、対象のファイルが想定されるパスに存在することを確認してください。
  
 <code bash> <code bash>
行 372: 行 383:
  
 After the restart, the sender only sends the lines written **after** the restart. To forward everything from the beginning of the current ''audit.log'', add ''readMode="2"'' to the ''imfile'' input and restart Rsyslog again. After the restart, the sender only sends the lines written **after** the restart. To forward everything from the beginning of the current ''audit.log'', add ''readMode="2"'' to the ''imfile'' input and restart Rsyslog again.
 +
 +再起動後、送信側は再起動**以降**に書き込まれた行のみを送信します。現在の ''audit.log'' の冒頭からすべてを転送するには、''imfile'' 入力に ''readMode="2"'' を追加し、Rsyslog を再度再起動します。
  
 <wrap #ks7 /> <wrap #ks7 />
-===== Operational review list =====+ 
 +===== 作業確認リスト =====
  
   * □ The receiver is online from the sender via ''TCP 10514''.   * □ The receiver is online from the sender via ''TCP 10514''.
行 382: 行 396:
   * □ The receiver's //log// file contains **only** lines with the ''pandora-audit'' //tag// (without ''CROND'' / ''rsyslogd'').   * □ The receiver's //log// file contains **only** lines with the ''pandora-audit'' //tag// (without ''CROND'' / ''rsyslogd'').
   * □ ''systemctl enable rsyslog'' applied on both //hosts// so that forwarding survives a restart.   * □ ''systemctl enable rsyslog'' applied on both //hosts// so that forwarding survives a restart.
 +
 +  * □ 送信元から受信側へ ''TCP 10514'' で接続可能である。
 +  * □ 両端で ''rsyslogd -N1'' を実行し、設定に問題がないことを確認済みである。
 +  * □ 受信側で ''ss -ltn | grep 10514'' を実行すると、''LISTEN'' 状態であることが確認できる。
 +  * □ ''audit.log'' に追加したテスト行が、ポーリング間隔以内に ''/var/log/received/pandora-audit.log'' へ反映される。
 +  * □ 受信側のログファイルには、''pandora-audit'' タグが付いた行**のみ**が含まれている(''CROND'' や ''rsyslogd'' などの行は含まれない)。
 +  * □ 再起動後も転送が継続されるよう、両ホストで ''systemctl enable rsyslog'' が実行されている。
  
 [[ja:documentation:pandorafms:start|Pandora FMS ドキュメント一覧に戻る]] [[ja:documentation:pandorafms:start|Pandora FMS ドキュメント一覧に戻る]]
  
  • ja/documentation/pandorafms/technical_annexes/rsyslog-audit-forwarding.1784413901.txt.gz
  • 最終更新: 2026/07/18 22:31
  • by junichi