This is the multi-page printable view of this section.
Click here to print.
Return to the regular view of this page.
The structure of a log message
The following sections describe the structure of log messages. Currently there are two standard syslog message formats:
Example messages on the wire
The same event in each format, to illustrate how the standards differ:
BSD-syslog (RFC 3164) — the <PRI> is followed directly by a legacy Mmm dd hh:mm:ss timestamp, the host, and the message:
<34>Oct 11 22:14:15 mymachine su: 'su root' failed for lonvick on /dev/pts/8
IETF-syslog (RFC 5424) — the <PRI> is followed by a version digit and an ISO 8601 timestamp, then the structured header fields:
<34>1 2026-10-11T22:14:15+00:00 mymachine su - - - 'su root' failed for lonvick on /dev/pts/8
EWMM — an RFC 5424 frame with @syslog-ng as the program and the message carried as JSON:
<34>1 2026-10-11T22:14:15+00:00 mymachine @syslog-ng - - - {"PROGRAM":"su","MESSAGE":"'su root' failed for lonvick on /dev/pts/8","HOST":"mymachine","._TAGS":[".source.s_network"]}
1 - 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.
Note
RFC 3164 is lenient about what a message must contain: senders may omit the
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.
Note
The AxoSyslog application supports longer messages as well. For details, see the
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 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.
Note
The AxoSyslog application supports other timestamp formats as well, like ISO, or the PIX extended format. For details, see the
ts-format() global option.
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.
2 - IETF-syslog messages
This section describes the format of a syslog message, according to the IETF-syslog protocol. A syslog message consists of the following parts:
HEADER (includes the PRI as well)
STRUCTURED-DATA
MSG
The following is a sample syslog message (source: https://tools.ietf.org/html/rfc5424):
<34>1 2003-10-11T22:14:15.003Z mymachine.example.com su - ID47 - BOM'su root' failed for lonvick on /dev/pts/8
The message corresponds to the following format:
<priority>VERSION ISOTIMESTAMP HOSTNAME APPLICATION PID MESSAGEID STRUCTURED-DATA MSG
| Part |
Example |
PRI |
<34> |
VERSION |
1 |
TIMESTAMP |
2003-10-11T22:14:15.003Z |
HOSTNAME |
mymachine.example.com |
APP-NAME |
su |
PROCID |
- |
MSGID |
ID47 |
STRUCTURED-DATA |
- |
MSG |
'su root' failed for lonvick on /dev/pts/8 |
The HEADER part of the message must be in plain ASCII format, the parameter values of the STRUCTURED-DATA part must be in UTF-8, while the MSG part should be in UTF-8. The different parts of the message are explained in the following sections.
Note
In RFC 5424, the PRI and VERSION are mandatory. The remaining HEADER fields (TIMESTAMP, HOSTNAME, APP-NAME, PROCID, MSGID) and the STRUCTURED-DATA must be present, but can be the NILVALUE - when the sender has no value for them. The MSG part is optional.
The PRI message part
The PRI is calculated and interpreted exactly as in BSD-syslog messages (facility * 8 + severity). For the formula and the facility and severity code tables, see The PRI message part.
The HEADER part contains the following elements:
- VERSION: Version number of the syslog protocol standard. Currently this can only be
1.
- ISOTIMESTAMP: The time when the message was generated in the ISO 8601 compatible standard timestamp format (yyyy-mm-ddThh:mm:ss+-ZONE), for example:
2006-06-13T15:58:00.123+01:00.
- HOSTNAME: The machine that originally sent the message.
- APPLICATION: The device or application that generated the message
- PID: The process name or process ID of the syslog application that sent the message. It is not necessarily the process ID of the application that generated the message.
- MESSAGEID: The ID number of the message.
Note
The AxoSyslog application supports other timestamp formats as well, like ISO, or the PIX extended format. The timestamp used in the IETF-syslog protocol is derived from RFC3339, which is based on ISO8601. For details, see the
ts-format() option in
Global options reference.
The AxoSyslog application will truncate the following fields:
- If APP-NAME is longer than 48 characters it will be truncated to 48 characters.
- If PROC-ID is longer than 128 characters it will be truncated to 128 characters.
- If MSGID is longer than 32 characters it will be truncated to 32 characters.
- If HOSTNAME is longer than 255 characters it will be truncated to 255 characters.
The STRUCTURED-DATA message part
The STRUCTURED-DATA message part may contain meta-information about the syslog message, or application-specific information such as traffic counters or IP addresses. STRUCTURED-DATA consists of data blocks enclosed in brackets ([]). Every block includes the ID of the block, and one or more name=value pairs. The AxoSyslog application automatically parses the STRUCTURED-DATA part of syslog messages, which can be referenced in macros (for details, see Macros of AxoSyslog). An example STRUCTURED-DATA block looks like:
[exampleSDID@0 iut="3" eventSource="Application" eventID="1011"][examplePriority@0 class="high"]
The MSG message part
The MSG part contains the text of the message itself. The encoding of the text must be UTF-8 if the BOM
<!-- DISCLAIMER: This file is based on the syslog-ng Open Source Edition documentation https://github.com/balabit/syslog-ng-ose-guides/commit/2f4a52ee61d1ea9ad27cb4f3168b95408fddfdf2 and is used under the terms of The syslog-ng Open Source Edition Documentation License. The file has been modified by Axoflow. -->
The byte order mark (BOM) is a Unicode character used to signal the byte-order of the message text.
character is present in the message. If the message does not contain the BOM character, the encoding is treated as unknown. Usually messages arriving from legacy sources do not include the BOM character. CRLF characters will not be removed from the message.
3 - Enterprise-wide message model (EWMM)
The following section describes the structure of log messages using the Enterprise-wide message model or EWMM message format.
<!-- DISCLAIMER: This file is based on the syslog-ng Open Source Edition documentation https://github.com/balabit/syslog-ng-ose-guides/commit/2f4a52ee61d1ea9ad27cb4f3168b95408fddfdf2 and is used under the terms of The syslog-ng Open Source Edition Documentation License. The file has been modified by Axoflow. -->
The Enterprise-wide message model or EWMM allows you to deliver structured messages from the initial receiving AxoSyslog component right up to the central log server, through any number of hops. It does not matter if you parse the messages on the client, on a relay, or on the central server, their structured results will be available where you store the messages. Optionally, you can also forward the original raw message as the first AxoSyslog component in your infrastructure has received it, which is important if you want to forward a message for example, to a SIEM system. To make use of the enterprise-wide message model, you have to use the syslog-ng() destination on the sender side, and the default-network-drivers() source on the receiver side.
<!-- DISCLAIMER: This file is based on the syslog-ng Open Source Edition documentation https://github.com/balabit/syslog-ng-ose-guides/commit/2f4a52ee61d1ea9ad27cb4f3168b95408fddfdf2 and is used under the terms of The syslog-ng Open Source Edition Documentation License. The file has been modified by Axoflow. -->
The following is a sample log message in EWMM format.
<34>1 2026-10-11T22:14:15+00:00 my-host @syslog-ng - - - {"PROGRAM":"su","MESSAGE":"'su root' failed for lonvick on /dev/pts/8","HOST":"mymachine","HOST_FROM":"my-host","._TAGS":[".source.s_network"]}
The message has the following parts:
| Part |
Example |
HEADER |
<34>1 2026-10-11T22:14:15+00:00 my-host @syslog-ng - - - |
MESSAGE |
{"PROGRAM":"su","MESSAGE":"'su root' failed …","HOST":"mymachine", …, "._TAGS":[".source.s_network"]} |
The header complies with the RFC5424 message format, where the PROGRAM field is set to @syslog-ng and the STRUCTURED-DATA field is empty. The MESSAGE part is in JSON format and contains the actual message, as well as any name-value pairs that AxoSyslog has attached to or extracted from the message. The ${._TAGS} field contains the identifier of the AxoSyslog source that originally received the message on the first AxoSyslog node.
To send a message in EWMM format, you can use the syslog-ng() destination driver, or the format-ewmm() template function.
To receive a message in EWMM format, you can use the default-destination-drivers() source driver, or the ewmm-parser() parser.
4 - The PRI message part
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 PRI (priority) part of a syslog message, which encodes the message’s facility and severity. The PRI is used the same way by the BSD-syslog and IETF-syslog protocols.
The PRI message part
The PRI part of the syslog message (known as Priority value) represents the Facility and Severity of the message. Facility represents the part of the system sending the message, while Severity marks its importance.
The Priority value is calculated using the following formula:
<PRI> = ( <facility> * 8) + <severity>
That is, you first multiply the Facility number by 8, and then add the numerical value of the Severity to the multiplied sum.
Example: the correlation between facility value, severity value, and the Priority value in the PRI message part
The following example illustrates a sample syslog message with a sample PRI field (that is, Priority value):
<133> Feb 25 14:09:07 webserver syslogd: restart
In this example, <133> represents the PRI field (Priority value). The syslog message’s Facility value is 16, and the Severity value is 5.
Substituting the numerical values into the <PRI> = ( <facility> * 8) + <severity> formula, the results match the Priority value in our example:
<133> = ( <16> * 8) + <5>.
Facility and Severity values
The possible Facility values (between 0 and 23) and Severity values (between 0 and 7) each correspond to a message type (see Table 1: syslog Message Facilities), or a message importance level (see Table 2: syslog Message Severities).
Note
Facility and severity are set by the sender and used inconsistently, and their names have varied across platforms over time, so a code’s name or description is not a reliable indicator of the message. The descriptions follow RFC 5424, while the macro values are the traditional BSD names. AxoSyslog also accepts Facility codes as numerical values.
syslog Message Facilities
The following table lists possible Facility values. The Name column shows the ${FACILITY} macro value.
Numerical Code (${FACILITY_NUM}) |
Name (${FACILITY}) |
Facility |
| 0 |
kern |
kernel messages |
| 1 |
user |
user-level messages |
| 2 |
mail |
mail system |
| 3 |
daemon |
system daemons |
| 4 |
auth |
security/authorization messages |
| 5 |
syslog |
messages generated internally by syslogd |
| 6 |
lpr |
line printer subsystem |
| 7 |
news |
network news subsystem |
| 8 |
uucp |
UUCP subsystem |
| 9 |
cron |
clock daemon |
| 10 |
authpriv |
security/authorization messages |
| 11 |
ftp |
FTP daemon |
| 12 |
ntp |
NTP subsystem |
| 13 |
security |
log audit |
| 14 |
console |
log alert |
| 15 |
solaris-cron |
clock daemon |
| 16-23 |
local0-local7 |
locally used facilities (local0-local7) |
syslog Message Severities
The following table lists possible Severity values. The Name column shows the ${SEVERITY} macro value (${LEVEL} and ${PRIORITY} are aliases).
Numerical Code (${LEVEL_NUM}) |
Name (${SEVERITY}) |
Severity |
| 0 |
emerg |
Emergency: system is unusable |
| 1 |
alert |
Alert: action must be taken immediately |
| 2 |
crit |
Critical: critical conditions |
| 3 |
err |
Error: error conditions |
| 4 |
warning |
Warning: warning conditions |
| 5 |
notice |
Notice: normal but significant condition |
| 6 |
info |
Informational: informational messages |
| 7 |
debug |
Debug: debug-level messages |
Note
A message that arrives without a PRI — from a non-syslog source such as
OpenTelemetry or a file, or a syslog message that omits the
<PRI> field — defaults to facility
user and severity
notice (PRI
13). Use the source’s
default-facility() and
default-priority() options to change this.
Setting the facility and severity
To override the facility and severity of a message, use the set-facility() and set-severity() rewrite rules:
rewrite r_pri {
set-facility("local0");
set-severity("err");
};
With FilterX, set the combined PRI value with set_pri() (facility * 8 + severity, so local0 (16) and err (3) give 131):
filterx {
set_pri(131);
};
Both examples set the message to local0.err. Assigning the macros directly (such as $SEVERITY or $PRIORITY) does not work — they are read-only, macro-based values.