Can anyone help me with a quick PERL question?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



First off let me state that I don't want to have to subscribe to a list for just
one question and I'm assuming that someone out here in this technical savy group
can help me.

I'm trying to parse some log files into fields. There are no clear field
separators (or it's the : and it interferes with the timestamp but I could do
this if I can't figure it out this way but it would require more work around.
Here is one line from the log:

<165>Oct 01 2004 19:57:52: %PIX-5-111008: User 'enable_15' executed the 'logging
trap 5' command.

I want to break this into different fields and arrange the date for importation
into a database. This is my line I can tell the the variable is set but my
pattern matching is correct and I could use a pair of eyes to help me figure out
what I'm doing wrong. Below is my REGEX parsing line (I've been changing it to
try and get it to work:

if ($raw =~
/(^<\d\d\d>)(\w\w\w)\s+(\d\d)\s+(\d\d\d\d)\s*(\d\d:\d\d:\d\d):\s+(%\w\w\w-\d+-\d+):\s*(\w*$)
) { ...

It's not matching the pattern for some reason and I can tell where my problem
is...  Again I know it's not a perl list but I someone can help me out there.

Thanks,

James



[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux