Rsyslog By default can only transfer the system log, such as Dhcp,cron, now to send a service log to the remote Rsyslog server, how to do it?
Workaround: To use the Rsyslog imfile module.
Reference official url:http://www.rsyslog.com/doc/v8-stable/configuration/modules/imfile.html
Reference online URL:HTTP://WWW.TUICOOL.COM/ARTICLES/JV2EUVN
Rsyslog configuration file (the content of the comment is filtered out):
[Email protected] ~]# cat/etc/rsyslog.conf | Egrep-v "#|^$"
$ActionFileDefaultTemplate Rsyslog_traditionalfileformat
$IncludeConfig/etc/rsyslog.d/*.conf
*.info;mail.none;authpriv.none;cron.none/var/log/messages
authpriv.*/var/log/secure
Mail.*-/var/log/maillog
Cron.*/var/log/cron
*.emerg *
Uucp,news.crit/var/log/spooler
local7.*/var/log/boot.log
$ModLoad Imfile
$InputFileName/usr/local/pf/logs/packetfence.log
$InputFileTag packetfence:
$InputFileSeverity Info
$InputFileStateFile stat-packetfence
$InputFileFacility LOCAL5
$InputFilePollInterval 1
$InputFilePersistStateInterval 1
$InputRunFileMonitor
local5.* @10.64.41.223:514
[Email protected] ~]#
After modifying the configuration file, restart the service
[Email protected] ~]#/etc/init.d/rsyslog restart
Shutting down system logger: [OK]
Starting system logger: [OK]
[Email protected] ~]#
The red font is a new configuration for transferring /usr/local/pf/logs/packetfence.log to 10.64.41.223:514.
Application logs are sent using Rsyslog