Hello PerL adepts. Mine is a newbie problem. I did spend quite a few hours looking for the solution. to no avail.
Let me just say, that it is a priviledge to be in the company of merlyn. And I think that this site is great.
I need to go through seven directories that contain tons of gz logs, I haven't been able to figure out a way to have my program process the gzipped files, currently i give a timestamp as an argument, and all logs from prospective directories with matching timestamp in the name of the file get looked at, they are not compressed, eventually i'll have to give a starting period and an ending period and make it so it's real easy to use for the marketing folk. this is my relevant code:


@hostnames = qw(baloo beast belle chip cogsworth lefou potts); my $timestamp=$ARGV[0]; for ($c=0; $c<@hostnames; $c++){ my $logpath = "/archive/$hostnames[$c]/www/logs/access_log.$timestamp" +; #print "$logpath\n"; open (LOGS,"$logpath") || die "cant open $logpath\n"; while (<LOGS>){ regex{ get valuable data here; } }
my questions are several:

1. how do i make this process the gz files? (i tried using * in place of the $timestamp, but that wasnt working, i wonder if i'll have to deflate and then parse(which will take ages))

2. what would be the most elegant way to do the above(1)

3. in your oppinion what is the simplest easiest to use time date parser, and what would be a good way to implement it.

Thank's to everyone that took the time to read this longwinded post. i'd be thrilled to get your stance on this. thanks for the help.


~vili
roaming the perl labyrinth

In reply to parse gzipped weblogs by vili

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.