Network ✓ fields verified against sample logs

Syslog Format: Field Reference, Priority Values and Example Records

Published

One record per message a program hands to the system logger: a priority value encoding facility and severity, a timestamp, the host and the program that produced it, and a free-text message whose structure is decided by the program, not by syslog.

Sample record

<30>1 2024-03-15T08:00:01.000Z web-01 sshd 1234 - Accepted publickey for deploy from 10.10.1.5 port 43210 ssh2: RSA SHA256:abc123
<30>1 2024-03-15T08:00:15.500Z web-01 sudo 5678 - deploy : TTY=pts/0 ; PWD=/var/www/app ; USER=root ; COMMAND=/usr/bin/systemctl restart nginx
<30>1 2024-03-15T08:05:00.000Z web-01 sshd 1234 - Disconnected from user deploy 10.10.1.5 port 43210

From the LogTriage parser test corpus — synthetic data, no real hosts or users.

Explain this record field by field →

Field reference

Field Type Meaning Why it matters for security
SRC IPv4/IPv6 (message body key) Source address in Linux netfilter kernel log messages, as in the `[BLOCK] IN=eth0 OUT= ... SRC=... DST=10.0.0.1` lines of the port-scan sample. One SRC value against many DPT values within a second is a port scan, and the same address reappearing in sshd messages links the scan to the logon attempts.
DSTe.g. 10.0.0.1 IPv4/IPv6 (message body key) Destination address of the packet the kernel logged. Shows which internal host was probed or reached.
PROTOe.g. TCP string (message body key) Transport protocol recorded in the kernel firewall message. Separates TCP connection attempts from UDP probes when triaging a burst of blocks.
DPTe.g. 22 integer (message body key) Destination port of the logged packet. Counting distinct DPT values per SRC is the port-scan check; 22, 3306, 5432, 6379 and 27017 in one burst is service discovery.
INe.g. eth0 string (message body key) Interface the logged packet arrived on; the matching OUT key is empty on these inbound, blocked packets. Tells you whether a blocked packet came from the external interface or from inside, which decides how urgent the burst is.
MACe.g. aa:bb:cc:dd:ee:ff string (message body key) Link-layer header bytes the kernel recorded for the packet; present on only the first block line in the sample. On a local segment it can tie traffic to a device when the source address itself is spoofed, but it is absent from most lines and stops at the nearest router.
SYNe.g. SYN flag (message body token) TCP flag appended to the kernel firewall message; every blocked packet in the port-scan sample is a bare SYN. SYN-only packets with no established session are connection attempts — the shape of a scan rather than of a conversation that was cut off.
TTYe.g. pts/0 string (message body key) Terminal sudo was invoked from, from the sudo message body. A pts value means an interactive session; sudo from a non-interactive context is worth separating from desk work.
PWDe.g. /var/www/app path (message body key) Working directory sudo was invoked in. Puts the command in context — an escalated command run from a web root or a temp directory reads differently from one run from a home directory.
USERe.g. root string (message body key) Target user of a sudo command, from the sudo message body. USER=root from an account that does not normally escalate is worth a look, and it names the identity the command actually ran as.
COMMANDe.g. /usr/bin/systemctl restart nginx string (message body key) The command line sudo was asked to run. The record of what was done with elevated rights — read it alongside the invoking account and TTY.
uide.g. 0 integer (message body key) Numeric user ID in pam_unix session messages, as in the cron `session opened for user root by (uid=0)` lines. Distinguishes a session a daemon opened as root from one opened on behalf of a logged-in user.
porte.g. 43210 integer (message body key) Remote port in sshd messages, written as `port 43210` rather than as a key=value pair. Climbing source ports from one address across consecutive failures, as in the port-scan sample, indicate one scripted client rather than several users.

Have one of your own records? Paste it into the log line explainer and each field is explained from this table, with times, codes and addresses decoded — in your browser.

What it records

A syslog record is one message a program handed to the system logger. In the RFC 5424 lines of these samples the header is positional and unnamed: a priority value in angle brackets (<30>), the protocol version (1), an RFC 3339 timestamp (2024-03-15T08:00:01.000Z), the host the sender claims to be (web-01), the program (sshd), usually a process ID (1234, a bare - on the kernel lines) and an optional message identifier, nil as - throughout both files. Everything after that header is free text whose layout the emitting program decides, which is why the table above documents the named keys that appear inside message bodies — accounts, addresses, ports and commands exist nowhere else.

The priority value is the only structured verdict in the header. It is facility × 8 + severity, so <30> is daemon (3) with informational (6) severity, <34> is facility 4 with critical (2), <86> is facility 10 with informational, <134> is local0 (16) with informational and <11> is facility 1 with error (3). Facilities 4 and 10 are both labelled security/authorization messages in the standard, and which one a program uses is a configuration decision. Severity is the fastest way to narrow a noisy stream: in the port-scan sample the failed SSH logons arrive as <34> and the exhausted attempt limit as <11>, while the same sshd binary logs successful logons as <30> in the benign file.

The benign sample shows the range in a single file: sshd key and password logons and disconnects, sudo commands with TTY, PWD, USER and COMMAND, cron pam_unix session open and close lines, postfix connect and disconnect, and an ntpd time step.

Where to get it

Most Linux hosts write the local stream to /var/log/syslog (Debian, Ubuntu) or /var/log/messages (RHEL, Fedora), with authentication messages split into /var/log/auth.log or /var/log/secure. The same records are forwarded by rsyslog or syslog-ng to a collector or SIEM — UDP or TCP port 514 for plain transport, 6514 for syslog over TLS. Network devices, firewalls and appliances usually emit syslog as their only log export, which is why a collector sees several dialects at once. On systemd hosts, check whether entries reach the file at all or only the journal.

Parsing pitfalls

  • The field count varies line to line. The sshd and sudo lines in these samples have one - between the PID and the message, while the kernel lines have two. Strict RFC 5424 expects a structured-data field (- or [...]) after the message ID, and it is simply missing on some lines. Match the header with a tolerant regex; never split on whitespace and trust positions.
  • Two formats in one stream. BSD-style lines have no version and a timestamp with no year or zone. A parser built for one silently drops the other.
  • Priority is a number, not a string. Filtering on the text <30> misses the same program logging at a different severity, as sshd does between the two samples here.
  • The message body is prose. Wording differs between software versions and between sshd and PAM, and not every value is a key=value pair — sshd writes port 43210, netfilter writes DPT=22.
  • Relays and truncation. A relay can replace the hostname or re-stamp the time, implementations differ in the maximum message length they accept, and multi-line output arrives as several unrelated-looking records.

Detection ideas

  • SSH brute force and user enumeration: repeated Failed password for root and service accounts mixed with Invalid user lines from one source, ending in error: maximum authentication attempts exceeded — exactly the sequence in the port-scan sample, and the subject of the auth.log brute-force rule.
  • Port scanning: one SRC with kernel [BLOCK] lines to many distinct DPT values in seconds, as the sample shows across 22, 23, 80, 443, 3306, 5432, 6379, 8080, 8443 and 27017.
  • Scan then logon attempts: the same source address in both kernel and sshd messages within minutes — a far stronger signal than either alone.
  • Privilege escalation: sudo lines with USER=root from accounts that rarely escalate, read together with the COMMAND, PWD and TTY values.
  • Credential type drift: Accepted password for an account that is supposed to authenticate with Accepted publickey only.

The free browser analyzer runs these checks on a syslog file locally.

Detections and guides for Syslog (RFC 5424 / 3164)

Frequently Asked Questions

What is the difference between RFC 3164 and RFC 5424 syslog?
RFC 3164 describes the older BSD format — a priority value, a "Mmm dd hh:mm:ss" timestamp with no year or timezone, a hostname and a tag such as "sshd[1234]:" before the message. RFC 5424 adds a version number, an RFC 3339 timestamp, separate APP-NAME, PROCID and MSGID fields and a structured-data section. Collectors usually receive both shapes on the same port, so a parser has to detect which one it is looking at.
Why do two messages from the same program have different priority values?
Facility and severity are chosen by the program and its configuration, not by syslog itself. In these samples sshd appears as <30> (daemon, informational) for successful logons and <34> (facility 4, critical) for failed passwords, and the firewall uses <134> (local0, informational). Decode the priority instead of filtering on the literal text, and never treat the facility alone as proof of which subsystem a message came from.
Can I trust the hostname and program name in a syslog record?
Only as far as you trust the sender and the path. Plain UDP syslog has no authentication and no delivery guarantee, so messages can be forged or lost without a trace, and a relay may rewrite the hostname to its own. Use TCP or TLS transport where you can, and confirm anything that matters against host-side evidence such as auth logs, auditd or process telemetry.
How do systemd journal entries end up in these files?
On systemd hosts, journald holds the entries and either forwards them to the syslog daemon or is read by it, depending on how journald.conf and the rsyslog or syslog-ng configuration are set on that machine. Check both configurations before concluding that a host is not logging — the records may exist only in the journal, reachable with journalctl.

Analyze Syslog (RFC 5424 / 3164) logs

LogTriage auto-detects this format, enriches every IP, user agent and hash with threat intelligence, and writes an incident report mapped to MITRE ATT&CK.

Investigating something right now? LogTriage checks every address in the file against threat intelligence and writes the incident report: 10 analyses a month free. The incident pack adds the in-depth AI analysis and files up to 100 MB: 25 analyses for $19, one payment, no subscription. Pricing

How this page was made. The official definitions, field names and examples on it are copied by script from the sources it links and re-checked against them on every build. The investigation advice was drafted with AI from those sources and passed a separate review before publishing. What is checked, and how · found a mistake? [email protected]