can rsyslog transfer files present in a directory
- by Tarun
I have configured rsyslog and its working fine as its intended to be this is the conf files:
Server Side:
$template OTHERS,"/rsyslog/test/log/%fromhost-ip%/others-log.log"
$template APACHEACCESS,"/rsyslog/test/log/%fromhost-ip%/apache-access.log"
$template APACHEERROR,"/rsyslog/test/log/%fromhost-ip%/apache-error.log"
if $programname == 'apache-access' then ?APACHEACCESS
& ~
if $programname == 'apache-error' then ?APACHEERROR
& ~
*.* ?OTHERS
Client Side:
# Apache default access file:
$ModLoad imfile
$InputFileName /var/log/apache2/access.log
$InputFileTag apache-access:
$InputFileStateFile stat-apache-access
$InputFileSeverity info
$InputRunFileMonitor
#Apache default Error file:
$ModLoad imfile
$InputFileName /var/log/apache2/error.log
$InputFileTag apache-error:
$InputFileStateFile stat-apache-error
$InputFileSeverity error
$InputRunFileMonitor
if $programname == 'apache-access' then @10.134.125.179:514
& ~
if $programname == 'apache-error' then @10.134.125.179:514
& ~
*.* @10.134.125.179:514
Now in rsyslog can I instead of defining separate files can I give the complete directory so that the client sends all the log files automatically present in the directory /var/log/apache2 and on syslog server side these files gets automatically stored in different filenames?