in reply to Logfile analysis : How to differentiate records with timestamp

The output wasn't desirable because your program doesn't even compile.

You haven't declared $channel and $dt (the latter is declared in a comment).

The missing regex $channel should be your first shot, if you've got that, you can use $1 to create $dt