I have a log file with multiple line patterns. Something like this:
[name] [surname] [address] [phone] [birthdate] [lastlogin]
[key] [value]
[timestamp] [username] [url] [errcode] [srcip] [dstip]
[field1] [field2] [field3] [field4]
There are multiple types of records in this file and each record type must be dealt with differently. Each record has its own fields and they rarely overlap.
I need to extract each field in each record and then process them. How could I do that? Should I write a regex for each record type? Where should I put these regexes?
I've been searching for a solution, but didn't find anything.
Thanks.
↧