Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: webserver common log format file script

by ww (Archbishop)
on Sep 06, 2011 at 12:22 UTC ( #924370=note: print w/replies, xml ) Need Help??

in reply to webserver common log format file script

We may need just a little more help from you to offer help to you. Detail for us: what are the criteria by which a log entry should be ignored?

Working that one out, explicitly, may even give you the answer. :-)

But, that said, suggest you replace:

|| ($values[8]=~m/(304)/) || ($values[8]=~m/(302)/) || ($values[8]=~m/(301)


|| ($values[8]=~m/(30[124]/)

The use of the character class -- essentially meaning 'any of the elements inside the square brackets' will make your code more readable (and hence, more maintainable).

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://924370]
[Corion]: jthebarg: There is the switch keyword if you want that, but maybe a dispatch table is closer.
[Corion]: If by "case" you meant "case-insensitive ", see fc, uc and lc and perlop on the /i flag ;)
Corion waves to virtualsue
[virtualsue]: I have made a post for the first time in ... years
[marto]: hey virtualsue!
Eily thought about Neko Case first, something might be wrong with my brain's wiring
[virtualsue]: I recommended dbic-migration even though I am having trouble with it this week. It might be my fault.
[ambrus]: wow! I haven't seen you here for a long time, virtualsue
virtualsue waves back
[Eily]: it would have been 2 years in 2 weeks actually. And welcome back virtualsue :)

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (14)
As of 2017-09-26 13:46 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (295 votes). Check out past polls.