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"); }; log { source(src); destination(test-script); }; ---------------- Here's /tmp/testscript: ---------------- #!/bin/sh echo $1 > /tmp/arg ---------------- # cat /tmp/arg /var/log/HOSTS///// I'd like to be able to pass these things, especially message-specific things like facility. Is there a way and I'm just not seeing it? -- Nate Campi http://www.campin.net
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
participants (2)
-
Balazs Scheidler
-
Nate Campi