Perl regular expressions (Solved)
Hi,
I am trying to configure swatch, a program that uses regular expressions from perl to analyse log files. When a regular expression in the config file matches a line in a log file it can be showed on the terminal etc. The problem is that I don't know how perl works.
I want for example log the lines with "su" in it. It appears like "su[8957]:" in the log files but the number varies. The "su" line won't get logged if I only use "su" in my swatch config file, I should also use a regular expression from perl to grab the "[number]:" part.
I also want to log lines with "sudo:" in it, but it won't work if I use "sudo" and "sudo:" in my swatch config file, so I am looking for a solution for that also.
Does someone know how I can handle this?
Thanks for your help
Last edited by daYz; 08-05-2005 at 01:48 PM.
|