symgryph has asked for the wisdom of the Perl Monks concerning the following question:
I have written the following regexes to parse using memory 1-xxx for each given section:May 20 18:57:27 1.23.25.5 %ASA-6-106100 a6 [local4.info] access-list M +yaccess-Block permitted tcp outside/10.31.0.9(3803) -> inside/10.29.1 +0.91(4127) hit-cnt 1 300-second interval [0xa178b29d, 0x0]
I was wondering if my regexes are naieve and could be improved?Time: (^\S+\s\d+\s+\d+:\d+:\d+) using memory 1 Source Firewall: (\d+\.\d+\d+.\d+.\d+) using memory 1 Source part of firewall connection: access-list\s+(\S+)\s+(\S+)\s+(\S+)\s(\S+)\/(\d+\.\d+\.\d+\.\d+)\((\d+ +) 1=source acl 2=action 3=protocol 4=source interface 5=source ip 6=source port Destination part: Destination: ->\s+(\S+)/(\d+\.\d+\.\d+\.\d+)\((\d+) 1=Dest Interface 2=Destination IP 3=Destination Port \[(0x[0-9a-f]+) Matches RUle # 1=Rule#
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: A better way to parse this with regexes? Pix ASA logs
by rjt (Curate) on May 21, 2013 at 02:37 UTC | |
|
Re: A better way to parse this with regexes? Pix ASA logs
by Athanasius (Archbishop) on May 21, 2013 at 02:46 UTC | |
|
Re: A better way to parse this with regexes? Pix ASA logs
by Anonymous Monk on May 21, 2013 at 03:13 UTC |