[prev in list] [next in list] [prev in thread] [next in thread] 

List:       syslog-ng
Subject:    [syslog-ng] Stripping numerals in the destination
From:       Cliff Fogle <cliff () videoegg ! com>
Date:       2008-07-31 22:55:18
Message-ID: D0FB1A072021FC4B832114BEE5C7A24F05D9A32DEB () troca1 ! evlta ! ad ! videoegg ! com
[Download RAW message or body]

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... ______________________________________________________________________________
 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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic