0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

rsyslogでBIG-IPのログを集約してファイル出力する手順(RHEL9)

Posted at

はじめに

本記事では、F5 BIG-IP から RHEL9 サーバへ Syslog を転送し、特定のログファイルに保存する手順を解説します。ネットワーク機器やロードバランサからのログを一元的に管理する環境構築に役立ちます。

検証環境

種別 IPアドレス 用途
BIG-IP 172.31.43.247 syslog送信元
RHEL9 172.31.40.7 syslog受信・保存先

※ 本検証では SELinux および firewalld は無効化済みです。

1. BIG-IP 側の設定

1.1 remote syslog 設定を追加

以下の内容を /config/bigip.conf に追記します。

/config/bigip.conf
sys syslog {
    remote-servers {
        syslog-server1 {
            host 172.31.40.7
            remote-port 514
            local-ip 172.31.43.247
        }
    }
}

host:ログの転送先(RHEL9サーバのIPアドレス)
remote-port:syslog の受信ポート(通常 UDP 514)
local-ip:送信元IPを固定(BIG-IPの送信元アドレス)

1.2 設定を反映

tmsh load sys config

2. RHEL9 側の設定(rsyslog)

2.1 rsyslog の有効化とポート開放

BIG-IP からのログを rsyslog で受信し、特定ファイルに振り分けて保存します。

systemctl enable --now rsyslog

2.2 UDP で syslog を受信する設定

rsyslog はデフォルトでは UDP 受信を無効化しています。
有効化には以下の記述を /etc/rsyslog.conf に追加します。

/etc/rsyslog.conf
$ModLoad imudp
$UDPServerRun 514

2.3 BIG-IP からのログを専用ファイルに保存する設定

以下の設定を /etc/rsyslog.d/bigip.conf に記述します。

/etc/rsyslog.d/bigip.conf
if ($fromhost-ip == '172.31.43.247') then /var/log/bigip.log
& stop

if ($fromhost-ip == ...):送信元IPによるフィルタリング
& stop:以降のルールへの処理を停止し、ログの混在を防止

2.4 rsyslog 再起動

systemctl restart rsyslog

3. 動作確認

3.1 BIG-IP 側からテストログを送信

logger -p local0.info "Test log from BIG-IP"

3.2 RHEL9 側でログを確認

tail -f /var/log/bigip.log

Test log from BIG-IP というメッセージが確認できれば、syslog 転送と保存は正常に機能しています。

おわりに

BIG-IP からの syslog を Linux サーバで受け取り、用途ごとにログファイルを分離して管理することで、監視やトラブルシュートが格段にしやすくなります。
本記事の構成は、他のネットワーク機器(Fortigate、Cisco など)にも応用可能です。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?