【发布时间】:2013-08-23 17:20:18
【问题描述】:
我的/etc/rsyslog.conf中有以下声明:
# This one is the template to generate the log filename dynamically
$template DynFile,"/var/log/proxy/%$year%/%$month%/%$now%.log"
if $fromhost-ip == '192.168.1.1' then *.* ?DynFile
想法是将本地和远程日志拆分为单独的目录和文件。
rsyslog 守护程序启动时没有任何错误,但未创建预期的日志。如果我用简单的*.* ?DynFile 替换“if”语句,则会填充日志,但当然不会拆分它们。
【问题讨论】: