Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: Untangling Log Files

by kwaping (Priest)
on Feb 08, 2007 at 17:36 UTC ( [id://599066]=note: print w/replies, xml ) Need Help??

in reply to Untangling Log Files

Non-perl answer: Personally, I would use the unix grep command to extract the desired lines out of the log files, then redirect that output into another file, possibly with a sort wedged in the middle. This is on a unix box though, not sure what your OS is or if there's an equivalent set of commands for it.

Something like this:
grep -h process_identifier *.log | sort -options > process_identifier. +newlog

It's all fine and dandy until someone has to look at the code.

Replies are listed 'Best First'.
Re^2: Untangling Log Files
by loris (Hermit) on Feb 09, 2007 at 07:19 UTC

    Your suggestion is pretty much what I am doing already, but I want to automate the process a bit more so that I can generate the all the process-specific log files at once. So I think I shall try something like jettero's solution.

    Thanks anyway,


    "It took Loris ten minutes to eat a satsuma . . . twenty minutes to get from one end of his branch to the other . . . and an hour to scratch his bottom. But Slow Loris didn't care. He had a secret . . ." (from "Slow Loris" by Alexis Deacon)
      I see. Well, in "quick and dirty" style, you could wrap that system call in a foreach my $process ('this','that','the other') { ... } loop.

      It's all fine and dandy until someone has to look at the code.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://599066]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-06-15 10:26 GMT
Find Nodes?
    Voting Booth?

    No recent polls found

    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.