【问题标题】:how to syslog-ng to remote facility如何 syslog-ng 到远程设施
【发布时间】:2011-09-30 01:02:23
【问题描述】:

我有一台运行 syslog-ng 的主机。它在本地完成所有工作(创建日志文件等)。但是,我想将它的所有日志转发到远程机器 - 特别是远程机器上的一个设施(local4)。我尝试在目标中使用重写(set-facility)和模板(语法错误) - 但无济于事。

destination remote_server { 
  udp(\"172.18.192.8\" port (514)); 
  udp(\"172.18.192.9\" port (514));
}; 
rewrite r_local4 {
  set-facility(local4);
};
filter f_alllogs {
  level (debug...emerg);
};
log {
  source(local);
  filter(f_alllogs);
  rewrite(r_local4)
  destination(remote_server); 
};

【问题讨论】:

    标签: syslog-ng


    【解决方案1】:

    AFAIK,目前无法在 syslog-ng 中修改消息的功能。

    你有什么特别的原因吗?

    【讨论】:

    • 感谢您的回复:是的,我有一个设备,我想导出到远程服务器上的特定日志文件。我正在考虑执行logger 命令或其他操作,但认为必须有更好的方法。
    猜你喜欢
    • 2016-01-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-24
    相关资源
    最近更新 更多