Beefy Boxes and Bandwidth Generously Provided by pair Networks Russ
more useful options
 
PerlMonks  

Re^4: regex: extract multiple number of date patterns from certain lines

by Random_Walk (Parson)
on Mar 05, 2009 at 20:58 UTC ( #748663=note: print w/ replies, xml ) Need Help??


in reply to Re^3: regex: extract multiple number of date patterns from certain lines
in thread regex: extract multiple number of date patterns from certain lines

Of course you are right, there is nothing in POE::Wheel::FollowTail limiting me to regex. P.W.FT was just a nice framework I grabbed about 3 years ago to watch a bunch of logfiles for various patterns and then hand these off to arbitrary processing.

To keep the core log monitor small and clean and hopefully fast all it will accept is regex patterns. A config file defines these and the module to use for each one. When a pattern matches the 'forward' method of the registering object (instantiated at start up) is called and given refs to the pattern involved, the log file name and the matches. Code of arbitrary complexity can be executed in the object.

In the normal way of things the requirements started very simple years ago, even allowing a config file full of regexen was called overkill then by some. Now three years down the line this code runs fine on hundreds of production servers and happily fulfils all sorts of varied requirements. As I said I get a second bite of the cherry in the object the match is passed too. I am now using your regex (thanks) and post processing in the object to split the trailing dates then send them onto the sysmanagement bus, all works great.

I could change the monitor to accept coderefs as well as regex but that would involve re-write testing and change controlled deployment throughout a monster bureaucracy, of core production code. When I started this node I just thought I was missing something blindingly obvious in not getting my regex to work as I wanted, I was vexed. Now I know I had hit a limit of what is reasonable in a single line of regex.

Thanks again for your time, it is appreciated,
R.

Pereant, qui ante nos nostra dixerunt!


Comment on Re^4: regex: extract multiple number of date patterns from certain lines

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (16)
As of 2014-04-18 12:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (466 votes), past polls