!! CentOS 側 ! /etc/rsyslog.conf # Provides UDP syslog reception $ModLoad imudp # コメントアウトを解除(UDP) $UDPServerRun 514 # コメントアウトを解除(UDP) # Provides TCP syslog reception $ModLoad imtcp # コメントアウトを解除(TCP) $InputTCPServerRun 514 # コメントアウトを解除(TCP) $AllowedSender UDP, 127.0.0.1, *.example.jp, 192.168.0.0/24 # UDPの場合 $AllowedSender TCP, 127.0.0.1, *.example.jp, 192.168.0.0/24 # TCPの場合 ! /etc/rsyslog.d/fortigate.conf $template FG-Group1, "/home/var/log/%fromhost%/messages.log" :fromhost-ip, isequal, "192.168.70.253" -?FG-Group1 &stop ( 192.168.70.253 は fortigate の IP ) ! rsyslog.conf のチェック /etc/rsyslog.confのチェック rsyslogd -N 1 デフォルトの設定ファイル以外をチェックする場合 rsyslogd -N 1 -c /etc/rsyslog.d/hogehoge.conf ! logrotate /etc/logrotate.d/fortigate /home/var/log/FortiGateIPs/*.log { rotate 200 missingok notifempty weekly delaycompress sharedscripts postrotate /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true endscript } 動作確認 # logrotate -d /etc/logrotate.conf # logrotate -dv /etc/logrotate.d/fortigate ## # logrotate -f /etc/logrotate.conf CHECK # cat /var/lib/logrotate.status !selinux OFF にする # setenforce 0 ON ( インストール時 ) # setenforce 1 CHECK # getenforce !firewalld firewall-cmd --permanent --add-port=514/tcp firewall-cmd --permanent --add-port=514/udp firewall-cmd --reload systemctl restart rsyslog !! Appendix ! syslog https://forum.fortinet.com/tm.aspx?m=126739 https://cloud.freebit.com/support/faq/vdc/183/ ! CentOS7 on rsyslog https://tech.godpress.net/?p=765 https://milestone-of-se.nesuke.com/l7protocol/syslog/rsyslog-summary/ ! Yamaha-rtx1100 http://www.gadgets-today.net/?p=2180 ! Logの中身 https://docs2.fortinet.com/document/fortigate/6.0.4/log-message-reference/357866/log-message-fields