I use this perl module to read logfile's tail, split into parts and insert into a database:
http://search.cpan.org/~mgrabnar/File-Tail-0.99.3/Tail.pm It even detects when files are rotated and re-attachs to the newly created file. Hope it helps, Alejandro On Thu, Apr 24, 2008 at 3:42 PM, Luis Valencia < [EMAIL PROTECTED]> wrote: > Thanks Rodrigo, I have try this, but I need to do it at real time so many > times. > > I have to check for Failed sms for every sms that I insert on the table. > And when I put the double piped grep's on a bash script it doesn't work. > > So I thought on insert the access.log to a database on realtime, so I can > run queries any time. > > What do you think? > > Thanks for the help > > -----Original Message----- > From: Rodrigo Cremaschi [mailto:[EMAIL PROTECTED] > Sent: Jueves, 24 de Abril de 2008 07:46 a.m. > To: Luis Valencia > Cc: [email protected] > Subject: Re: dump access.log to a database > > It's quite easy to process kannel log files using "cat" and "grep" (or > fgrep) commands. > If you want to know the number of sent SMS for a certain short number, > you may try something like: > > cat access.log | grep "Sent SMS" | grep "\[from: 8888\]" | wc -l > > If your log file is already compressed: > > zcat access.log.gz | ... > > Hope this can help you. > > On Wed, Apr 23, 2008 at 10:08 PM, Luis Valencia > <[EMAIL PROTECTED]> wrote: > > > > > > > > > > Hi all, > > > > > > > > I need to do a lot of searches in the access.log information, but its > really > > nasty to do it on a text plain file. So I want to know if anyone ever > try > > to dump the access.log to a Mysql database table so I can run queries on > it? > > > > > > > > Anyone? Or any other option to do what I want? > > > > > > > > Thanks a lot in advance. > > > > > > > > Luis GT > > > > > > > > > > > > > > -- > > This message has been scanned for viruses and > > dangerous content by MailScanner, and is > > believed to be clean. > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > > >
