[syslog-ng] Week Number

John Franceschina jfran at ie-engine.com
Wed Jun 22 20:03:54 CEST 2005


I have tried searching the mail archives but I am unable to find
anything to do with the current week number.

Can anyone tell me if there is a way to get/use the current week number?
I would like to use the current week number as the table name to store
syslog(NG) messages.

syslog-ng --version
syslog-ng 1.6.8

My syslog-ng.conf

options {
    sync (0);
    time_reopen (10);
    log_fifo_size (1000);
    long_hostnames (off);
    use_dns (no);
    use_fqdn (no);
    create_dirs (no);
    keep_hostname (yes);
};

source s_sys {
    file ("/proc/kmsg" log_prefix("kernel: "));
    unix-stream ("/dev/log");
    internal();
    udp(ip(0.0.0.0) port(514));
};

destination d_mysql_syslog {
    pipe("/var/lib/mysql/mysql.pipe"
    template("INSERT INTO $WEEKNUMBER (host, facility, priority, level,
tag, date, time, program, msg)
                VALUES ( '$HOST', '$FACILITY', '$PRIORITY', '$LEVEL',
'$TAG', '$YEAR-$MONTH-$DAY', '$HOUR:$MIN:$SEC', '$PROGRAM', '$MSG'
);\n")
        template-escape(yes));
};

log { source(s_sys); destination(d_mysql_syslog); };

Any assistance would be greatly appreciated.

-- 
John
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.balabit.hu/pipermail/syslog-ng/attachments/20050622/23fc41e6/attachment.htm


More information about the syslog-ng mailing list