在CentOS上正确configurationRsyslog

我试图在CentOS 6.4上configurationRsyslog 5.8.10,将Apache的错误和访问日志发送到远程服务器。 这工作,但我有几个问题。

更新 :A,B和C是唯一的答案。

A)我想用尽可能less的队列(和资源)。 我发送错误日志到服务器A,发送访问日志到服务器A,发送两个日志在一个stream到服务器B.我应该指定一个队列每个外部服务 (2个队列)或一个队列每个stream (3队列,因为我现在)? 这是我的:

$ActionResumeInterval 10 $ActionQueueSize 100000 $ActionQueueDiscardMark 97500 $ActionQueueHighWaterMark 80000 $ActionQueueType LinkedList $ActionQueueFileName logglyaccessqueue $ActionQueueCheckpointInterval 100 $ActionQueueMaxDiskSpace 1g $ActionResumeRetryCount -1 $ActionQueueSaveOnShutdown on $ActionQueueTimeoutEnqueue 10 $ActionQueueDiscardSeverity 0 if $syslogtag startswith 'www-access' then @@logs-01.loggly.com:514;logglyaccess $ActionResumeInterval 10 $ActionQueueSize 100000 $ActionQueueDiscardMark 97500 $ActionQueueHighWaterMark 80000 $ActionQueueType LinkedList $ActionQueueFileName logglyerrorsqueue $ActionQueueCheckpointInterval 100 $ActionQueueMaxDiskSpace 1g $ActionResumeRetryCount -1 $ActionQueueSaveOnShutdown on $ActionQueueTimeoutEnqueue 10 $ActionQueueDiscardSeverity 0 if $syslogtag startswith 'www-errors' then @@logs-01.loggly.com:514;logglyerrors $DefaultNetstreamDriverCAFile /etc/syslog.papertrail.crt # trust these CAs $ActionSendStreamDriver gtls # use gtls netstream driver $ActionSendStreamDriverMode 1 # require TLS $ActionSendStreamDriverAuthMode x509/name # authenticate by hostname $ActionResumeInterval 10 $ActionQueueSize 100000 $ActionQueueDiscardMark 97500 $ActionQueueHighWaterMark 80000 $ActionQueueType LinkedList $ActionQueueFileName papertrailqueue $ActionQueueCheckpointInterval 100 $ActionQueueMaxDiskSpace 1g $ActionResumeRetryCount -1 $ActionQueueSaveOnShutdown on $ActionQueueTimeoutEnqueue 10 $ActionQueueDiscardSeverity 0 *.* @@logs.papertrailapp.com:XXXXX;papertrailstandard & ~ 

B)是否一个队列块被反复使用的每个send操作反复使用, 或者只能由第一个或者只有在send后跟一个丢弃操作 (〜)才被使用?

C)如何重置队列,以便即将到来的发送操作根本不使用队列?

D)一个TLS块是否被它后面的每个send动作反复使用, 或者只能由第一个send动作或者直到它遇到send后跟放弃动作 (〜)?

E)如何重置TLS块,以便即将到来的发送操作根本不使用TLS?

F)如果我运行rsyslog -N1我得到:

 rsyslogd -N1 rsyslogd: version 5.8.10, config validation run (level 1), master config /etc/rsyslog.conf rsyslogd: WARNING: rsyslogd is running in compatibility mode. Automatically generated config directives may interfer with your rsyslog.conf settings. We suggest upgrading your config and adding -c5 as the first rsyslogd option. rsyslogd: Warning: backward compatibility layer added to following directive to rsyslog.conf: ModLoad immark rsyslogd: Warning: backward compatibility layer added to following directive to rsyslog.conf: MarkMessagePeriod 1200 rsyslogd: Warning: backward compatibility layer added to following directive to rsyslog.conf: ModLoad imuxsock rsyslogd: End of config validation run. Bye. 

我在哪里放置-c5,以便它不再以兼容模式运行?

只要填写我知道的那些

D)是的,除了E)被调用以外的所有后续的。

E)在下一次发送之前是$ ActionSendStreamDriverMode 0。

Re:在哪里放置'-c5' – CentOS使用/etc/sysconfig/rsyslog作为rsyslog启动参数的configuration文件,所以你需要添加'-c5'作为SYSLOGD_OPTIONS =行的第一个参数,即

 SYSLOGD_OPTIONS="-c5" 

对不起,不回答你提出的所有其他问题。 如果你问他们是不是分开的话,我认为会好得多,因为在目前的forms下,你需要花费大量的时间来回答你问题中的每一个问题。