can rsyslog transfer files present in a directory

Posted by Tarun on Ask Ubuntu See other posts from Ask Ubuntu or by Tarun
Published on 2013-10-23T10:06:38Z Indexed on 2013/10/23 10:16 UTC
Read the original article Hit count: 226

Filed under:
|

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?

© Ask Ubuntu or respective owner

Related posts about 12.04

Related posts about rsyslog