[syslog-ng] Stripping numerals in the destination

Cliff Fogle cliff at videoegg.com
Fri Aug 1 00:55:18 CEST 2008


I have several server types, like web001-web100 and thumb001-thumb010 or db001-db004

I want each server type to log to the same file and I can't for the life of me figure out a regex for $HOST in the destination statement to strip numerals.

Where the first $HOST is below I want to do something like a sed "s/[0-9]*$//"

destination d_host {
        file("/log1/syslog/$HOST/$R_YEAR/$R_MONTH/$R_YEAR-$R_MONTH-$R_DAY"
                template("$ISODATE <$FACILITY.$PRIORITY> $HOST $MSG\n")
                template_escape(no)
);
};

Thanks for any help you can provide.  I've been banging my head against google for hours now...


More information about the syslog-ng mailing list