From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/520 Path: main.gmane.org!not-for-mail From: Csillag =?iso-8859-2?Q?Tam=E1s?= Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: syslog from perl but no date (svlogd) Date: Sat, 17 Jul 2004 12:27:06 +0200 Message-ID: <20040717102706.GJ7203@digitus> References: <20040715222109.GE7203@digitus> <20040716224352.GI7203@digitus> Reply-To: Csillag =?iso-8859-2?Q?Tam=E1s?= NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1090060049 20923 80.91.224.253 (17 Jul 2004 10:27:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 17 Jul 2004 10:27:29 +0000 (UTC) Cc: supervision@list.skarnet.org Original-X-From: supervision-return-758-gcsg-supervision=m.gmane.org@list.skarnet.org Sat Jul 17 12:27:19 2004 Return-path: Original-Received: from antah.skarnet.org ([212.85.147.14]) by deer.gmane.org with smtp (Exim 3.35 #1 (Debian)) id 1BlmPX-0004Sc-00 for ; Sat, 17 Jul 2004 12:27:19 +0200 Original-Received: (qmail 19908 invoked by uid 76); 17 Jul 2004 10:27:40 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Archive: Original-Received: (qmail 19902 invoked from network); 17 Jul 2004 10:27:40 -0000 Original-To: Charlie Brady Content-Disposition: inline In-Reply-To: <20040716224352.GI7203@digitus> X-Operating-System: Gnu/Linux X-PPKE-NOSPAM: I promise, I will never let anything happen to you. Nemo. User-Agent: Mutt/1.5.5.1+cvs20040105i X-PPKE-ITK-MailScanner: Found to be clean X-PPKE-ITK-MailScanner-SpamCheck: not spam, SpamAssassin (pont=-11.33, szukseges 5, autolearn=not spam, AWL 3.57, BAYES_00 -4.90, LOCAL_PPKE -10.00) Xref: main.gmane.org gmane.comp.sysutils.supervision.general:520 X-Report-Spam: http://spam.gmane.org/gmane.comp.sysutils.supervision.general:520 On 07/17, Csillag Tam=E1s wrote: > I will look to the code if it can be imlemented without messing up the > code. >=20 > Do you know what could be a prefered way? >=20 > Hmm, maybe some kind of processor can do the hard work for me. > Maybe a perl script?=20 >=20 > I will mail it here if I have a working solution. What do you think about this perl script? ____________________________________________________ #!/usr/bin/perl use warnings; use strict; my $l; while($l=3D) { $l=3D~/(\d\d\d\d-\d\d-\d\d_\d\d:\d\d:\d\d.\d\d\d\d\d \w+.\w+:) \w\w\w \d= \d \d\d:\d\d:\d\d (.+)/; if(defined $1 and defined $2) { print $1 . " " . $2 . "\n"; } else { print $l; } } ___________________________________________________ If I am not mistaken I can put this to svlogd's processor. (!perl processor.pl | gzip -9) $ cat file 2004-07-17_08:17:01.42255 user.notice: Jul 15 23:52:52 logger: test 3004-07-17_08:17:01.42255 mail.info: example.pl[3449]: test 4004-07-17_08:17:01.42255 user.notice: Jul 17 23:52:52 logger: test 5004-07-17_08:17:01.42255 mail.info: example.pl[3449]: test $ cat file | perl processor.pl 2004-07-17_08:17:01.42255 user.notice: logger: test 3004-07-17_08:17:01.42255 mail.info: example.pl[3449]: test 4004-07-17_08:17:01.42255 user.notice: logger: test 5004-07-17_08:17:01.42255 mail.info: example.pl[3449]: test --=20 cstamas