in reply to splitting a string that appears inconsistently in structure
Use the module URI to process the URI Component of the log file. This will give you accessors to the various elements you want, such as ->path and ->query.
In Section
Seekers of Perl Wisdom