The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Rsyslog forward log to remote syslog server

Discussion in 'General Discussion' started by garconcn, Jul 10, 2014.

  1. garconcn

    garconcn Well-Known Member

    Joined:
    Oct 29, 2009
    Messages:
    98
    Likes Received:
    1
    Trophy Points:
    8
    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
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page