将日志写入linux中的特定文件

将日志写入linux中的特定文件

我的日志从 StormShield 防火墙发送到我的 Debian 服务器,如下所示:

92.168.2.253 → 12.12.4.58   Syslog 758 USER.WARNING: 1 2021-12-22T10:45:38+01:00 FW-STORMSHIELD asqd - - - \357\273\277id=firewall time="2021-12-22 10:45:38" fw="FW-STORMSHIELD" tz=+0100 startime="2021-12-22 10:45:35" pri=4 confid=01 slotlevel=2 ruleid=56 rulename="17b8311aa81_10e" srcif="Ethernet5" srcifname="DMZ-OPENVPN" ipproto=tcp dstif="Ethernet0" dstifname="internet" proto=ssl src=192.168.13.153 srcport=64722 srcportname=port-tcp-sup srcname=P-WINSAV-007-alegal srcmac=00:0c:22:12:fd:82 dst=145.240.201.174 dstport=443 dstportname=https dstname=drive.google.com dstcontinent="na" dstcountry="us" modsrc=96.35.166.98 modsrcport=27922 ipv=4 action=block msg="ChangeCipherSpec trop t\303\264t" class=protocol classification=0 alarmid=312 target=dst repeat=2 l

我无权访问 Stormshield 防火墙配置,并且无法确定它们写入我的服务器上的哪个文件。

如果可能的话,我想将它们写入特定文件

我在 rsylog.conf 文件中尝试了此配置:

$template DynamicFile,"/var/log/syslogclients/%fromhost%-syslog.log"
*.* ?DynamicFile

动态创建一个日志文件并在每次收到日志时写入其中,但该文件仍为空。

我已经重新启动了rsyslog。我还缺少什么?

感谢您的帮助

相关内容