Here's a quick update on what I have so far. I separated this into 2 parts. The 1st part would be to output the info, filter it and have it display correctly from bottom up. Timestamp was cleaned up as well and displays with proper colors.
https://imgur.com/a/yPoDaF1
The 2nd part would be to do the telnet part. Adding another div to simulate a chat response text field and have that working behind the scenes.