Given the following sample log file line:
I am trying to campture the information in the lines to check for possible virus infestations. I tried using the regexAug 21 19:00:36 [1.1.1.3.200.125] 410381: Aug 21 23:00:35 UTC: %SEC-6- +IPACCESSLOGP: list 101 denied tcp 10.161.24.153(3988) -> 10.158.24.10 +(135), 1 packet Aug 21 19:00:36 [1.1.1.3.200.125] 410382: Aug 21 23:00:35 UTC: %SEC-6- +IPACCESSLOGDP: list 101 denied icmp 10.165.4.150 -> 211.95.79.233 (8/ +0), 1 packet
m@^([A-Z][a-z]+\s+\d+\s+\d+\:\d+\:\d+)\s+([\.\d]+)\s+(\d+)\:\s+([A-Z] +[a-z]+\s+\d+\s+\d+\:\d+\:\d+)\s+([A-Z]{3})\:\s+\%SEC\-6\-[A-Z]+\:\s+l +ist\s+\d+([a-z]+)\s+([a-z]+)\s+(\d+\.\d+\.\d+\.\d+)\s+\-\>\s+(\d+\.\d ++\.\d+\.\d+)\s+\(\d+\/\d+\)\,\s+(\d)\s+packet$@
I know I am going brain dead right now, but can anybody spot anything glaringly obvious with this that is wrong?
Peter @ Berghold . Net
Sieze the cow! Bite the day!
Nobody expects the Perl inquisition!
Test the code? We don't need to test no stinkin' code!
All code posted here is as is where is unless otherwise stated.
Brewer of Belgian style Ales
In reply to Cisco Log Files: broken REGEX by blue_cowdawg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |