Rsyslog forward log to remote syslog server

garconcn

Well-Known Member
Oct 29, 2009
158
12
68
I've setup a central syslog server using LogAnalyzer on CentOS6 server to consolidate all the cpanel logs. I created a config file in /etc/rsyslog.d/ to foward any log contains 'apache-access' to remote server, however, the same access log was also logged in /var/log/messages. Is there a way to only forward the apache log to remote server but not write to the message log file since it's been logged to the Apache access_log file already? Thank you.

===My custom rsyslog config===
$InputFileName /usr/local/apache/logs/access_log
$InputFileTag apache-access
$InputFileStateFile stat-apache-access
$InputFileSeverity warn
$InputFileFacility local5
$InputRunFileMonitor

if $syslogtag contains 'apache-access' then @192.168.1.11
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,222
463
Is there a way to only forward the apache log to remote server but not write to the message log file since it's been logged to the Apache access_log file already?
To clarify, the Apache access logs are logged to /var/log/messages on this machine? This is not standard behavior. Are you using any other third-party applications?

Thank you.
 
Thread starter Similar threads Forum Replies Date
I Operating Systems 1
jamiedolan Operating Systems 2