如何使用rsyslog从客户端到服务器logging文件
我已经设置了一个rsyslog服务器,它接受来自客户端的日志信息。 我可以成功接收syslog消息,但是我也有兴趣logging一些文件 。 这是我的客户的样子: $ModLoad imfile $InputFileName /var/log/drew-error.log $InputFileTag drew: $InputFileStateFile stat-drew-error $InputFileSeverity error $InputRunFileMonitor $InputFilePollInterval 1 我不确定要在我的服务器configuration。 理想情况下,我想要服务器输出这样的东西: /var/log/remote/$HOSTNAME/drew-error.log 我正在以正确的方式进行吗? 这是合理的尝试实现? 最佳案例场景: 我希望能够更新我在客户端上观看的文件,而不必重新configuration服务器。 如果这不可能,或者太难,我可以围绕一个硬编码的解决scheme工作。 我试过了 到目前为止,我已经尝试了一些服务器configuration(虽然我觉得他们不是正确的解决scheme/方法): $template syslog, "/var/log/remote/%hostname%/%programname%/%$year%%$month%%$day%/syslog" *.*;auth,authpriv.none ?syslog 和 $template DrewTemplate,"/var/log/remote-DREWAPP-%HOSTNAME%.log" if $programname == 'drew:' then -?DrewTemplate & ~ $template PerHostLog,"/var/log/remote-%HOSTNAME%.log" if $fromhost-ip startswith '1.2.' then -?PerHostLog & ~