Parse log files for data
From: Dan (agent_at_thwackspam.fathom.org)
Date: 07/31/04
- Next message: Mladen Gogala: "Re: Parse log files for data"
- Previous message: Uri Guttman: "Re: The code below returns me nothing."
- Next in thread: Mladen Gogala: "Re: Parse log files for data"
- Reply: Mladen Gogala: "Re: Parse log files for data"
- Reply: Tad McClellan: "Re: Parse log files for data"
- Reply: bowsayge: "Re: Parse log files for data"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 31 Jul 2004 05:49:11 GMT
I have a bunch of custom log files with database queries in them, and
would like to extract all the insert and update queries so I can
recreate some lost data.
I'm pretty sure this is the perfect exercise for a perl script. I
just don't have the vocabulary to write it myself. But this is all it
needs to do:
* Open, in order, all log files named yyyymmdd.log in the current
directory. (where yyyymmdd is what you think it is)
* For each file, look at each line, and if it begins with " query=
INSERT" or " query = UPDATE", write that entire line starting from the
word "INSERT" or "UPDATE" to the output file.
I'm not sure what version of perl I have or if that matters, but my
system is Fedora Core 2, so whatever comes with that...
Any takers? The 2 minutes of your time would be greatly appreciated.
:)
- Next message: Mladen Gogala: "Re: Parse log files for data"
- Previous message: Uri Guttman: "Re: The code below returns me nothing."
- Next in thread: Mladen Gogala: "Re: Parse log files for data"
- Reply: Mladen Gogala: "Re: Parse log files for data"
- Reply: Tad McClellan: "Re: Parse log files for data"
- Reply: bowsayge: "Re: Parse log files for data"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|