BSD-syslog or legacy-syslog messages
New to AxoSyslog? AxoSyslog is a binary compatible syslog-ng replacement, from the original creator, developed by the same team.
Same architecture, same config files, same paths. Cloud-native images, fast releases, modern observability (OTel, K8s), and powerful data processing: read more about the differences between AxoSyslog and syslog-ng.
Also, it’s super easy to install, and you can upgrade from syslog-ng in minutes.
This section describes the format of a syslog message, according to the legacy-syslog or BSD-syslog protocol. A syslog message consists of the following parts (the examples are taken from the sample message below):
| Part | Example |
|---|---|
PRI |
<34> |
HEADER |
Oct 11 22:14:15 mymachine |
MSG |
su: 'su root' failed for lonvick on /dev/pts/8 |
The total message cannot be longer than 1024 bytes.
The following is a sample syslog message
<34>Oct 11 22:14:15 mymachine su: 'su root' failed for lonvick on /dev/pts/8
The message corresponds to the following format:
<priority>timestamp hostname application: message
The different parts of the message are explained in the following sections.
PRI (and sometimes the HEADER), and receivers still accept such messages. When a message has no PRI, AxoSyslog assigns a default facility and severity (user.notice, PRI 13) — see The PRI message part.
log-msg-size() option in Global options reference. However, it is not recommended to enable messages larger than the packet size when using UDP destinations.
The HEADER message part
The HEADER message part contains a timestamp and the hostname (without the domain name) or the IP address of the device. The timestamp field is the local time in the Mmm dd hh:mm:ss format, where:
-
Mmm is the English abbreviation of the month: Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec.
-
dd is the day of the month on two digits. If the day of the month is less than 10, the first digit is replaced with a space. (for example, Aug 7.)
-
hh:mm:ss is the local time. The hour (hh) is represented in a 24-hour format. Valid entries are between 00 and 23, inclusive. The minute (mm) and second (ss) entries are between 00 and 59 inclusive.
The MSG message part
The MSG part contains the name of the program or process that generated the message, and the text of the message itself. The MSG part is usually in the following format: program[pid]: message text.