Re: Parse log files for data

From: Dan (agent_at_thwackspam.fathom.org)
Date: 08/01/04


Date: Sun, 01 Aug 2004 06:02:13 GMT

On Sat, 31 Jul 2004 14:49:19 -0400, Mladen Gogala
<gogala@sbcglobal.net> wrote:

>On Sat, 31 Jul 2004 18:28:22 +0000, bowsayge wrote:
>
>> while (<$fh>) {
>> print if (/^query = (INSERT|UPDATE)/x);
>> }
>
>That will print the whole line. He wants to print just the part after
>INSERT or UPDATE.

Not just after, but including. If it grabs the whole line that's
fine. I can easily remove the " query= " from the beginning of each
line.

But at the moment it's not grabbing anything. It just lists all the
files at the end.

Here's a sample entry from one of the log files (just the beginning of
each line):

===00:23:54 on Mon July 26, 2004===
 HTTP_REFERER=
 HTTP_HOST= www.vi...
 REQUEST_URI= /ult...
 HTTP_USER_AGENT= Moz...
 REMOTE_ADDR= 203...
 query= INSERT INTO sc...

Spacing is slightly different, so I modified the regex accordingly to
(/^ query= (INSERT|UPDATE)/x) but it still found nothing.



Relevant Pages

  • Re: IISState File Help Needed
    ... Not from the .log files. ... There is from the .dmp files, ... will give you the page names which may tell you what queries are running. ... Basically, it looks like the query was created, a connection ...
    (microsoft.public.inetserver.iis)
  • Re: Audit Log
    ... > I wanted a query regarding archiving the data from the log files. ... > Server Enterprise Manager or Query Analyzer we can not have the log. ...
    (microsoft.public.sqlserver.security)
  • Re: Importing XML for Newbies
    ... Why not just use an XQuery implementation to query them direct? ... I see no requirement here to involve a database at all. ... Create a DB for storing the log files? ...
    (microsoft.public.sqlserver.xml)
  • Parse log files for data
    ... I have a bunch of custom log files with database queries in them, ... I'm pretty sure this is the perfect exercise for a perl script. ... * Open, in order, all log files named yyyymmdd.log in the current ... INSERT" or " query = UPDATE", write that entire line starting from the ...
    (comp.lang.perl.misc)
  • Re: MS Query capabilities/regex
    ... Not so bad, but at home I'm a Mac user, and VBScript seems to be dead-ended... ... MS Query uses Access SQL which is similar to T-SQL - you can use expressions with wildcards % and ?, but not regex AFAIK. ...
    (microsoft.public.excel.newusers)