Messages cut off, duplicated or showing the wrong host

safe intermediate #truncated#maxmessagesize#duplicate#hostname#mtu

When to use this: Long log lines are truncated, folders are named wrongly, or messages appear twice.

Steps

  1. Raise the maximum message size

    terminal
    sudo nano /etc/rsyslog.conf

    Add global(maxMessageSize="64k") near the top of the main config (before modules and inputs are loaded), then run sudo rsyslogd -N1 and restart. Long firewall log lines can exceed small defaults.

  2. Prefer TCP for long messages

    Over UDP, a long message may be split by the network (fragmentation) or dropped. TCP delivers long messages reliably.

  3. Use the sender IP, not the header hostname

    Wrong or blank host names are common because many devices do not put a proper hostname in the syslog header. The rsyslog example on this site names folders by %fromhost-ip% for that reason.

  4. Find duplicates

    The same event appearing twice usually means two syslog destinations pointing to the same server (for example syslogd and syslogd2 on a FortiGate), or a client that both forwards and is also forwarded by a relay. Remove the extra path.

How to verify it worked

  • Full-length lines appear and each sender has exactly one folder.

Common errors and fixes

Still truncated after raising the size The sender itself may cut long messages, or an intermediate device does. Test with a captured packet and compare the original length.

Q&A

Why are my long logs cut?

A size limit in the server (maxMessageSize), the sender or the transport. Raise the server limit and use TCP.

Why use the IP address instead of the hostname for folders?

The IP is always known to the server. Header hostnames are often missing or wrong on network devices.

Practice these as flashcards →

Terms in this scenario

Related scenarios

My notes

Saved in this browser only.