Можно сделать следующее. Можно установить корень на основе запроса $host.
местоположение / {
базируйтесь/usr/local/$host/www/;
}
One solution is to check the $programname (which gets populated with the value from $InputFileTag on the client for each file you monitor).
On the client, create your file monitor(s), and make sure $InputFileTag starts with 'file-'. Here is an example with log files foo and bar:
######################### START /var/log/foo.log
$InputFileName /var/log/foo.log
$InputFileTag file-foo:
$InputFileStateFile stat-foo
$InputFileSeverity info
$InputRunFileMonitor
######################### END /var/log/foo.log
######################### START /var/log/bar.log
$InputFileName /var/log/bar.log
$InputFileTag file-bar:
$InputFileStateFile stat-bar
$InputFileSeverity info
$InputRunFileMonitor
######################### END /var/log/bar.log
And then on the server, check that $programname starts with 'file-' (as should be the case for all of your file monitors, but not for any of the standard syslog messages). Here is an example:
$template FileTemplate,"/var/log/remote-%HOSTNAME%-%programname%.log"
if $programname startswith 'file-' then -?FileTemplate
& ~