[syslog-ng]macro expansion in program destinations
Balazs Scheidler
syslog-ng@lists.balabit.hu
Thu, 5 Jun 2003 09:22:52 +0200
On Wed, Jun 04, 2003 at 10:02:58AM -0700, Nate Campi wrote:
> I might be missing something obvious here, but is there a way to get
> macros to expand when used as arguments to external scripts?
>
> ex:
> ----------------
> destination test-script {
> program("/tmp/testscript /var/log/HOSTS/$HOST/$YEAR/$MONTH/$DAY/$FACILITY_$HOST_$YEAR_$MONTH_$DAY");
> };
there's no point in specifying message specific arguments to a script as the
program is only started once, and it receives messages via its standard
input. you can however control the format of the messages to be sent using:
destination test-script {
program("/tmp/testscript" template("/var/log/HOSTS/$HOST/$YEAR/$MONTH/$DAY/$FACILITY_$HOST_$YEAR_$MONTH_$DAY"));
};
the program will then receive filenames on its standard input, opening and
caching those files (as each filename may occur more than once) should be
done in the script.
--
Bazsi
PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1