^M, or 015, is a "CR" in ASCII. What you're missing is linefeeds (
However, it is unusual for syslog output to use CRs like that. Logging over the network does not use any particular line endings – the client is required to send one message per UDP datagram, or to explicitly specify the message length when using stream transports. The messages only get line separators added when they're written out to
/var/log, so if your
/var/log/messages were lacking LFs, it would be your syslogd that was broken.
But that is not the case, since you say in your comment that "it shows ^M literally".
tail does not translate CRs to
^M, it just dumps data to stdout. Instead, it could be that your device does send multiple lines per datagram, and your syslog daemon translates them to a literal
M sequence when writing the log files. (I have rsyslogd here, it converts a CR to
In other words, your device does not follow the syslog protocol.
You can use the following to convert such a "
^M" sequence to a real Unix newline (a LF):
(If you want CR+LF's, use