Skip to content

Commit 45d7b86

Browse files
committed
Add systemd-journald example mapping to logs data model appendix
Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
1 parent d500678 commit 45d7b86

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

specification/logs/data-model-appendix.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ the respective exporter documentation if exact details are required.
1717
* [Apache HTTP Server access log](#apache-http-server-access-log)
1818
* [CloudTrail Log Event](#cloudtrail-log-event)
1919
* [Google Cloud Logging](#google-cloud-logging)
20+
* [systemd-journald](#systemd-journald)
2021
* [Elastic Common Schema](#elastic-common-schema)
2122
- [Appendix B: `SeverityNumber` example mappings](#appendix-b-severitynumber-example-mappings)
2223
- [References](#references)
@@ -499,6 +500,31 @@ When mapping from the unified model to HEC, we apply this additional mapping:
499500
| trace_sampled | boolean | The sampling decision of the trace associated with the log entry. | TraceFlags.SAMPLED |
500501
| All other fields | | | `Attributes["gcp.*"]` |
501502

503+
### systemd-journald
504+
505+
| Field | Type | Description | Maps to Unified Model Field |
506+
| ----- | ---- | ----------- | --------------------------- |
507+
| `_SOURCE_REALTIME_TIMESTAMP` or `__REALTIME_TIMESTAMP` | uint64 | Use `_SOURCE_REALTIME_TIMESTAMP` (the earliest trusted timestamp of the message) if present; otherwise fall back to `__REALTIME_TIMESTAMP` (the wallclock time at which the entry was received by the journal). Both are CLOCK_REALTIME in microseconds since the UNIX epoch. `_SOURCE_REALTIME_TIMESTAMP` is optional and only present when the source timestamp differs from journal reception time; `__REALTIME_TIMESTAMP` is always present. | Timestamp |
508+
| `PRIORITY` | number | Syslog-compatible priority value (0=Emergency … 7=Debug). | Severity |
509+
| `_HOSTNAME` | string | The name of the originating host. | `Resource["host.name"]` |
510+
| `_MACHINE_ID` | string | The machine ID of the originating host as configured in machine-id(5). | `Resource["host.id"]` |
511+
| `_SYSTEMD_UNIT` | string | The systemd unit name of the service that generated the log entry (e.g. `nginx.service`). | `Resource["service.name"]` |
512+
| `SYSLOG_FACILITY` | number | Syslog compatibility field: the syslog facility (formatted as decimal string). See [RFC5424 FACILITY](#rfc5424-syslog). | `Attributes["syslog.facility"]` |
513+
| `SYSLOG_IDENTIFIER` | string | Syslog compatibility field: the identifier string (i.e. "tag"). Equivalent to the RFC5424 APP-NAME. Used as service name when `_SYSTEMD_UNIT` is not present. | `Resource["service.name"]` |
514+
| `SYSLOG_PID` | number | Syslog compatibility field: the client PID from the original syslog datagram. See [RFC5424 PROCID](#rfc5424-syslog). | `Attributes["syslog.procid"]` |
515+
| `MESSAGE` | string | The human-readable log message. | Body |
516+
| `TID` | number | The numeric thread ID the log message originates from. | `Attributes["thread.id"]` |
517+
| `_PID` | number | The process identifier (PID) of the process that generated the log entry. | `Resource["process.pid"]` |
518+
| `_UID` | number | The user identifier (UID) of the process that generated the log entry. | `Resource["process.user.id"]` |
519+
| `_COMM` | string | The name of the executable (as found in /proc/\<pid\>/comm). | `Resource["process.executable.name"]` |
520+
| `_EXE` | string | The path to the executable. | `Resource["process.executable.path"]` |
521+
| `_CMDLINE` | string | The command line of the process. | `Resource["process.command_line"]` |
522+
| `_SYSTEMD_CGROUP` | string | The control group path in the systemd hierarchy of the process. | `Resource["process.linux.cgroup"]` |
523+
| `CODE_FILE` | string | The source code file generating this message. | `Attributes["code.file.path"]` |
524+
| `CODE_LINE` | number | The source code line generating this message. | `Attributes["code.line.number"]` |
525+
| `CODE_FUNC` | string | The source code function generating this message. | `Attributes["code.function.name"]` |
526+
| All other fields | any | All other journal fields. | `Attributes["journald.*"]` |
527+
502528
### Elastic Common Schema
503529

504530
<table>

0 commit comments

Comments
 (0)