[Neworleans-pm] split vs. match
David B. John
djohn at archdiocese-no.org
Tue Oct 28 09:20:06 PDT 2008
On Tue, 2008-10-28 at 08:13 -0500, B. Estrade wrote:
> > >
> > > You do need the /g at the end, of course.
>
> Do you or don't you? I am not familiar with using the "g" switch in a pure match - I usually just use it when doing global search and replaces.
>
If /g was not used then it would only match once.
>
> David:
>
> Is this for Apache? If so, you are treading on well-worn ground -
>
> http://www.google.com/search?q=perl+parse+apache+log+file&ie=utf-8&oe=utf-8&aq=t&rls=com.ubuntu:en-US:unofficial&client=firefox-a
I wish it was, that would be easier ;)
This is how the Astaro Firewall spits out the http proxy logs.
>
> Also, if you want to analyze your log files, you may want to check out AWStats - http://awstats.sourceforge.net/.
>
> Lastly, you can try an approach that essentially parses parts of the file in parallel. I am not familiar with writing multi-threaded Perl scripts, but that would allow you to get further speed-up once you've found the magic regex to use. Of course, you might have to deal with bringing back the results in some ordered way, so it is a rather advanced approach to take.
Yep, we use AWStats for the web sites on Plesk.
I'll be alright with the regex approach. Essentially, I wrote a parser
in bash a while back that matches keywords and excludes certain url's in
order to see who's browsing pron @ work. I've been too lazy to redo it
right in Perl. Just getting around to it. ;)
On Tue, 2008-10-28 at 08:16 -0500, B. Estrade wrote:
>
>
> You should check out a fairly old language called APL -
> http://en.wikipedia.org/wiki/APL_programming_language
>
> People are saying that Perl is becoming more LISP-like and more
> APL-like :).
>
Now that's intriguing. LISP to. I wonder how much LISP T2 has? ;)
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/neworleans-pm/attachments/20081028/e2cfe050/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://mail.pm.org/pipermail/neworleans-pm/attachments/20081028/e2cfe050/attachment.bin>
More information about the NewOrleans-pm
mailing list