Look at http://www.balabit.com/dl/guides/syslog-ng-v3.0-guide-admin-en.pdf in the "macros" section. You can use variables inside the file() statement. It even has an example doing exactly what youre wanting to do.

Sent: Wednesday, March 03, 2010 5:48:49 AM
From: peceka <peceka@gmail.com>
To: syslog-ng@lists.balabit.hu
Subject: [syslog-ng] composing file names with system varible
Hi,

i've on my machine file with some name, for example:
# cat /var/hostname
smeagol

now i want to have log files like this:
/var/log/smeagol-all.log

if i change content of /var/hostname and then restart syslog-ng,
syslog-ng shoud start logging to files with new name.

is it possible? mabye no directly but with some workaround?

regards,
p.
______________________________________________________________________________
Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng
FAQ: http://www.campin.net/syslog-ng/faq.html