journald and systemd capabilities support Linux distributions running
systemd 239 or greater. The syslog capability doesn’t require systemd.
Supported telemetry types
The Linux integration supports these telemetry types:Prerequisites
The Linux integration has the following prerequisites:- Run the Collector directly on each Linux host with
mode: host. - The
journaldcapability is enabled by default. When enabled, the host must havejournalctl, and the account that runs the Collector must be able to read the system journal. Therootaccount and members of thesystemd-journalgroup normally have access. Some distributions also grant access through groups such asadmorwheel. Runid -nG ACCOUNTto list an account’s groups, and usegetfaclto inspect journal access control lists. To run the Linux integration without journal access, setcxdot.integrations.linux.journald.enabledtofalse. Thesystemdandsyslogcapabilities don’t require journal access. - The
systemdcapability, enabled by default, requires the host to run systemd as its service manager and make the D-Bus system bus available. Runsystemctl --versionto confirm the systemd version. - Disable a capability if the host doesn’t meet its requirements. A host that enables
only the
syslogcapability doesn’t require systemd orjournalctl.
Configure
The Linux integration runs by default on Linux hosts. It collects journal records of priorityinfo and more severe from the whole system journal, and the active state of
each matching, currently loaded systemd service unit. Journal collection starts at the
end of the journal when the Collector starts, so records already in the journal aren’t
collected. Forwarded syslog collection is off by default.
To configure the Linux integration, follow these steps:
-
Run the Collector in host mode and configure a logs exporter. The default
configuration requires no
linuxblock. If you use tenant egress, enable logs as shown in the following Collector configuration: -
Optional: Keep the journal read position across Collector restarts. By default the
Collector resumes at the end of the journal after a restart, so records written
while it was down aren’t collected. Enable checkpoint storage and name a directory
that already exists and that the account running the Collector can write to. For
example, add the following to the Collector configuration file:
-
Optional: Accept syslog forwarded by the host’s syslog daemon or by network
devices. By default, the listener accepts UDP on
127.0.0.1:5514and parses RFC 5424 messages. For example, enable the listener in the Collector configuration:Then configure the sender to forward to the listener. For example, for rsyslog, create/etc/rsyslog.d/50-cxdot.confwith the following content and restart rsyslog:The protocol-23 template is broadly available across versions and is accepted by the listener’s RFC 5424 parser. The condition on the program name excludes log records that the Collector writes. Without it, the error the Collector writes when an export fails is forwarded to the listener and exported again, which fails again. Thejournaldcapability drops records that the Collector writes; thesyslogcapability doesn’t, so the sender must exclude them. If the host’s syslog daemon forwards other records that thejournaldcapability also collects, the two capabilities produce duplicate records. Narrow the sender’s selection, or disablejournaldonly when you intend syslog to replace journal collection. -
Optional: Change the listener’s address, transport, or message format. Set
udportcp, not both, because the listener uses one transport. Setprotocolto the format the sender emits. For example, add the following to the Collector configuration file to accept RFC 3164 messages from other hosts over TCP:With the default Linux privileged-port threshold, a listen address on a port lower than1024requires the Collector to run asrootor with theCAP_NET_BIND_SERVICELinux capability. RFC 3164 timestamps carry no time zone. If the senders’ clocks show a zone other than UTC, setlocationto that zone so the Collector reads their timestamps correctly. -
Optional: Secure the TCP listener, or match the sender’s framing. A listener that
accepts connections from other hosts carries log records across the network, so
configure TLS for it with a certificate and key the Collector can read, and set
client_ca_fileto accept only senders that present a certificate signed by that authority. If the sender frames each message with its length in octets, setenable_octet_counting: true. For example, add the following to the Collector configuration file:Then configure the senders to connect with TLS and to use the same framing. Theudplistener has no TLS or framing settings. -
Optional: Narrow journal collection. Set
priorityto a more severe level to collect fewer records, or setunitsto collect from specific systemd units only. For example, add the following to the Collector configuration file: -
Optional: Select the currently loaded systemd units to report state for. The
unitslist replaces the default*.servicepattern, so include that pattern to continue reporting services. Each unit produces one time series per possible state, so a wide pattern on a host with many units produces many time series. For example, add the following to the Collector configuration file to report timers and services:The Collector also reportssystemd.service.restarts, the number of times systemd has automatically restarted each service. Setservice_restarts: falseto stop collecting it. A configuration with alinuxblock that declares aschema_versionbefore 1.8 keeps this metric off until you raise the version. Setservice_cpu_time: trueto also collect CPU time per service. This setting requires cgroup v2 on the host. -
Optional: Disable the integration, or one of its capabilities, to stop collecting
from a host. For example, add the following to the Collector configuration file to
stop collecting unit states while continuing to collect journal records:
Set
enabled: falsedirectly underlinuxto disable the whole integration.
Validate
To validate the Linux integration, follow these steps:-
In Live Telemetry Analyzer, filter for
__name__=cxdot.integration.target.health cxdot.integration.name=linux. Confirm that each enabled capability reports1. Use thecxdot.integration.checkandcxdot.integration.targetattributes to identify the capability and the host for each result. -
Optional: If the
systemdcapability is enabled, in Metrics Explorer, run the following query:Confirm that the query returns a time series with the value1for each Linux host. If you narrowedunits, query a unit that the list includes. -
Optional: If the
journaldcapability is enabled, on a Linux host, write a test record to the journal:In Logs Explorer, filter for["cxdot.integration.name"] = "linux" AND "Linux integration test". Confirm that the record appears with itsSYSLOG_IDENTIFIERfield set tocxdot-test. -
Optional: If you enabled the syslog listener, send a test message to it from the
host. Adjust the address, port, and transport if you changed the listener:
In Logs Explorer, filter for
["cxdot.integration.name"] = "linux" AND "Linux syslog test". Confirm that the record appears.
Troubleshooting
- The
journaldcapability reports health0: The account that runs the Collector can’t read the system journal,journalctlisn’t on itsPATH, or the host has no system journal. Runjournalctl --system --lines=1as that account. A message that mentionsinsufficient permissionsmeans the account lacks access to one or more system journal files. Check its groups and the journal access control lists. - The
journaldcapability reports health1, but no records appear: The Collector collects only records written after it started, and only records of priorityinfoand more severe unlessprioritysays otherwise. Also confirm that a logs exporter is configured. If you use tenant egress, enablecxdot.egress.tenant.signals.logs. - No records from the service that runs the Collector appear through
journald: Thejournaldcapability drops records written by thecxdot-collector.serviceunit and thecxdot-collectorprocess. A syslog forwarder can reintroduce those records unless its selector excludes them. - The
systemdcapability reports health0: The Collector can’t reach the system bus. The host doesn’t run systemd, or the Collector runs in a container without the system bus socket. Disable thesystemdcapability on such hosts. - The
syslogcapability reports health0: Another process holds the listen address, usually the host’s own syslog daemon or a second Collector, or the port is lower than1024and the Collector lacks the privilege to bind it. Changelisten_addressor grant the privilege, then restart the Collector. - Forwarded syslog records arrive as a single opaque line: The sender’s format doesn’t
match
protocol. The default rsyslog forwarding template and syslog-ng’snetwork()destination emit RFC 3164, so setprotocol: rfc3164for those senders. - Records forwarded over TCP run together or arrive cut mid-message: The sender’s framing
doesn’t match the listener’s. A sender that prefixes each message with its length needs
enable_octet_counting: true. - RFC 3164 records carry a timestamp that’s off by a whole number of hours: The senders’
clocks show a time zone other than UTC. Set
locationto that zone. - The
syslogcapability reports health0and the Collector logs a failed-to-load-location error at startup: Thelocationvalue isn’t a valid time zone name. Use an Internet Assigned Numbers Authority (IANA) name such asAmerica/New_York. The Collector reads zone names from the host’s time zone database, typically thetzdatapackage under/usr/share/zoneinfo, so a valid name also fails on a host that lacks this data. Install the package or useUTC. systemd.service.restartsis missing and the Collector logs a collection error: The host runs a systemd release older than 235, which the integration doesn’t support. Setservice_restarts: falseon such hosts to stop the error.service_cpu_timeis enabled, butsystemd.service.cpu.timeis missing and the Collector logs a collection error: The host uses cgroup v1 or a hybrid hierarchy, and per-service CPU time requires cgroup v2. Runstat -fc %T /sys/fs/cgroup, which printscgroup2fson a host that supports it.
Configuration reference
Configure one Linux integration instance with the following settings. In a Collector configuration file, place them undercxdot.integrations.linux.
Optional settings
-
enabledType:boolean. Optional. Default:true. Whether to enable this configuration block. If true, the Collector runs the integration or capability. If false, the Collector doesn’t run it. -
collection_intervalType:duration. Optional. Default:60s. How often the Collector collects systemd unit state and checks whether each enabled capability can reach what it reads. Journal and syslog records arrive as they’re written, so this setting doesn’t pace log collection. -
timeoutType:duration. Optional. Default:60s. Time limit for each unit-state collection and each health check. The journal health check runsjournalctl, and this is the deadline on that command. -
journaldType:object. Optional. Settings for collecting records from the systemd journal on each host, and for reporting whether the Collector can read that journal. -
journald.enabledType:boolean. Optional. Default:true. Whether to enable this configuration block. If true, the Collector runs the integration or capability. If false, the Collector doesn’t run it. -
journald.priorityType:string. Optional. Default:info. Lowest journal priority to collect. The value follows thejournalctlconvention of this level and more severe. This setting controls how many journal records the Collector sends, so watch the volume after you configure a logs exporter.infois the level at whichsshd,sudo,cron, and most daemons write records such as logins. Set a more severe level, such aswarning, when your hosts produce more volume than you want to collect. Allowed values:emerg,alert,crit,err,warning,notice,info,debug. -
journald.unitsType:array of string. Optional. Minimum items:1. Names of systemd units to collect journal records from, for examplesshd.service. When unset, the Collector collects the whole journal. Usepriorityto control volume, and this setting to limit collection to the units you need. Whatever this setting contains, the Collector drops its own records, matched by thecxdot-collector.serviceunit or thecxdot-collectorprocess name. When systemd runs the Collector, its log output lands in the journal, so without this exclusion an export failure would be read back as a record and sent through the pipeline that’s failing. -
journald.drop_fieldsType:regex. Optional. Default:^(__|_AUDIT_|_(BOOT|MACHINE)_ID|_CAP_EFFECTIVE|_CMDLINE|_EXE|_SELINUX_CONTEXT|_STREAM_ID|_RUNTIME_SCOPE|_SOURCE_.*TIMESTAMP|_SYSTEMD_(CGROUP|SLICE|USER_SLICE|OWNER_UID|SESSION|INVOCATION_ID)|_HOSTNAME|SYSLOG_(PID|TIMESTAMP|RAW)). Minimum length:1. Regular expression matched against each field name in a journal record’s body. Every field that matches is deleted before export. A journal record’s body contains nearly the entirejournalctl --output=jsonentry, typically 20 to 30 fields and roughly ten times the size of the message itself. The Collector uses__REALTIME_TIMESTAMPas the record timestamp and removes that field before this expression runs. The default removes identifier and bookkeeping fields:__CURSOR,_BOOT_ID,_MACHINE_ID,_CMDLINE,_EXE, the_SYSTEMD_cgroup and session fields,_HOSTNAME, and theSYSLOG_transport fields._HOSTNAMEis removed because every record already carries the host as a resource attribute.SYSLOG_PID,SYSLOG_TIMESTAMP, andSYSLOG_RAWare sender-provided values that can differ from the journal’s trusted process ID, timestamp, and normalized message. The fields that remain are the ones an operator filters on:MESSAGE,PRIORITY, which the Collector also maps to the record’s severity,_SYSTEMD_UNIT,SYSLOG_IDENTIFIER,SYSLOG_FACILITY,_PID,_COMM,_TRANSPORT,_UID,_GID, and any field a program wrote into its own journal entries, such asCODE_*,UNIT, andUSER_UNIT.SYSLOG_FACILITYremains because nothing else on the record says whether a syslog-transported message came fromauth,authpriv,cron, ordaemon. To keep a field the default removes, set a pattern that doesn’t match it. To keep every field, set a pattern that matches no field name, such as^$. The pattern can’t contain backslashes or double quotes, so write[0-9]rather than\d. Journal field names contain only uppercase letters, digits, and underscores, so a pattern over them needs no escapes. Matching is unanchored unless the pattern anchors it, which is why the default begins with^. The pattern must be a valid RE2 regular expression. A pattern that doesn’t compile, such as one with an unbalanced parenthesis, is rejected when the Collector loads its configuration, with an error that names this setting. -
systemdType:object. Optional. Settings for collecting the state of systemd units on each host, and for reporting whether the Collector can reach the system bus it reads them from. -
systemd.enabledType:boolean. Optional. Default:true. Whether to enable this configuration block. If true, the Collector runs the integration or capability. If false, the Collector doesn’t run it. -
systemd.unitsType:array of string. Optional. Default:["*.service"]. Minimum items:1. Patterns for the systemd units to report state for, in the systemd sense of unit:.service,.timer,.socket,.mount, and so on. The list replaces the default, so include*.serviceto keep reporting services. The Collector reports matching, currently loaded units; it doesn’t enumerate every unit file installed on disk. This is the setting to narrow when the number of time series matters.systemd.unit.stateis emitted once per unit per possibleactive_state, and there are eight states, so a host with 120 loaded matching service units produces around 960 time series from it. Each unit is also its own resource, carryingsystemd.unit.name. An explicit list of unit names, or a subset of services such as["sshd.service", "nginx.service"], brings the count down on a host with an unusual number of units. Widen the list the same way, for example["*.service", "*.timer"]. -
systemd.service_cpu_timeType:boolean. Optional. Default:false. Whether to collectsystemd.service.cpu.time, the total CPU time per service. If true, the Collector reads each service’s CPU time from its cgroup on every collection. If false, the metric isn’t collected. Requires cgroup v2, the unified hierarchy. On a cgroup v1 or hybrid host, each service contributes a partial collection error, and the Collector logs the combined error once per collection interval. RHEL and CentOS 7 and 8, Ubuntu before 21.10, Amazon Linux 2, and Debian 10 all default to a non-unified hierarchy. To confirm the hierarchy, runstat -fc %T /sys/fs/cgroup, which printscgroup2fson a unified host. -
systemd.service_restartsType:boolean. Optional. Default:true. Whether to collectsystemd.service.restarts, the number of times systemd has automatically restarted each service since the service was last started by hand. The value is the unit’sNRestartsproperty, which counts restarts that aRestart=setting triggered after the process exited. A manualsystemctl restartisn’t counted and resets the count to zero. The Collector reads the property over the system bus on every collection, one time series per matching.serviceunit, with no cgroup requirement. A rising value identifies a service that keeps exiting whilesystemd.unit.statereports itactivebetween restarts. The property exists on systemd 235 and later. If false, the metric isn’t collected. -
syslogType:object. Optional. Settings for the syslog listener each host opens, and for reporting whether that listener is up. -
syslog.enabledType:boolean. Optional. Default:false. Whether to accept syslog forwarded byrsyslog,syslog-ng, or a network device. If true, the Collector opens a listener and collects the messages sent to it as log records. If false, the Collector opens no listener. The other capabilities read state the Collector can already see, while this one collects nothing until a sender is configured to forward to it. On a host that runsrsyslogorsyslog-ng, the journal generally carries the same records already.enabled: trueon its own listens on UDP127.0.0.1:5514and parses RFC 5424. Setudportcpto move or change the listener, andprotocolto match what the sender emits. Journal and syslog records require a logs exporter. If you use tenant egress, enablecxdot.egress.tenant.signals.logs. -
syslog.udpType:object. Optional. Default:{"listen_address":"127.0.0.1:5514"}. UDP listener. The default is the loopback address on a high port, which suits a forwarder on the same host and is the only address that’s safe to choose by default:0.0.0.0would open the host to the network, and the conventional port 514 needs privilege to bind and is usually already held by the host’s syslog daemon. Widen the address to accept from other hosts, for example0.0.0.0:5514. Settcpinstead for a TCP listener. The two blocks are exclusive. -
syslog.udp.listen_addressType:string. Required. Minimum length:1.<host>:<port>to receive syslog messages over UDP on. Required whensyslog.udpis configured. -
syslog.tcpType:object. Optional. TCP listener, for forwarders configured to use TCP. Unset by default. Set it in place ofudp, not beside it. The listener splits the stream on newlines and accepts plaintext connections unlessenable_octet_countingortlssay otherwise. -
syslog.tcp.listen_addressType:string. Required. Minimum length:1.<host>:<port>to accept syslog connections on. Required whensyslog.tcpis configured. -
syslog.tcp.enable_octet_countingType:boolean. Optional. Default:false. Whether each message on the TCP stream starts with its length in octets, the octet-counting framing of RFC 6587. If false, the Collector splits the stream on newlines, which is the framingrsyslogandsyslog-ngemit over TCP unless configured otherwise. Set true for a sender configured for octet counting, such asrsyslogwithTCP_Framing="octet-counted". A stream framed one way and read the other produces records that run together or are split mid-message. -
syslog.tcp.tlsType:object. Optional. Transport layer security (TLS) settings for the TCP listener. When set, the listener accepts only TLS connections. Requires a certificate and key: eithercert_fileandkey_file, orcert_pemandkey_pem. A file and its PEM alternative can’t both be set. The Collector maskskey_pemand the trusted platform module authorization values in diagnostic output. Setclient_ca_fileto require and verify a client certificate from each sender. When unset, the listener accepts plaintext connections, which suits a forwarder on the same host. A listener that accepts connections from other hosts carries log records across the network, so configure TLS for it and configure the senders to use TLS. Only TCP supports TLS;udphas no equivalent setting. -
syslog.tcp.tls.cert_fileType:string. Optional. Path to the PEM-encoded certificate file the listener presents to each sender. Pair it withkey_file;cert_pemandkey_pemare the in-memory alternative. -
syslog.tcp.tls.cert_pemType:string. Optional. PEM-encoded certificate content the listener presents to each sender, in place ofcert_file. -
syslog.tcp.tls.cipher_suitesType:array of string. Optional. TLS cipher suites the listener accepts, in preference order. If omitted, the Collector uses the secure defaults from the Go TLS library. For supported names, see https://go.dev/src/crypto/tls/cipher_suites.go. -
syslog.tcp.tls.client_ca_fileType:string. Optional. Path to a PEM-encoded certificate authority (CA) certificate file. If set, the listener requires each sender to present a certificate signed by that authority and rejects connections that don’t. If omitted, the listener accepts any sender that completes the TLS handshake. -
syslog.tcp.tls.client_ca_file_reloadType:boolean. Optional. Whether to reloadclient_ca_filewhen the file changes on disk, so a rotated authority takes effect without restarting the Collector. If false, the Collector reads the file once at startup. -
syslog.tcp.tls.curve_preferencesType:array of string. Optional. Elliptic curves the listener accepts for an elliptic curve Diffie-Hellman ephemeral handshake, in preference order. If omitted, the Collector uses the Go TLS library defaults. -
syslog.tcp.tls.key_fileType:string. Optional. Path to the PEM-encoded private key file for the certificate incert_file. -
syslog.tcp.tls.max_versionType:string. Optional. Maximum TLS protocol version the listener accepts. If omitted, the Collector uses the maximum version supported by the Go TLS library. -
syslog.tcp.tls.min_versionType:string. Optional. Minimum TLS protocol version the listener accepts. If omitted, the minimum version is TLS 1.2. -
syslog.tcp.tls.reload_intervalType:duration. Optional. How often the Collector reloads the listener’s certificate and key files, so a renewed certificate takes effect without a restart. If omitted, the Collector doesn’t reload them. -
syslog.tcp.tls.key_pemType:string. Optional. PEM-encoded private key content for the certificate incert_pem, in place ofkey_file. -
syslog.tcp.tls.tpmType:object. Optional. Trusted platform module settings for the listener’s private key. -
syslog.tcp.tls.tpm.enabledType:boolean. Optional. Whether to use a trusted platform module for the TLS private key. If true, the Collector loads the key from the configured device or socket. If false, the Collector uses the configured key file or in-memory key. -
syslog.tcp.tls.tpm.pathType:string. Optional. Path to the trusted platform module device or Unix domain socket, such as/dev/tpm0or/dev/tpmrm0. -
syslog.tcp.tls.tpm.authType:string. Optional. Authorization value for the trusted platform module key. -
syslog.tcp.tls.tpm.owner_authType:string. Optional. Owner authorization value for the trusted platform module. -
syslog.protocolType:string. Optional. Default:rfc5424. Wire format the sender emits.rfc5424is the current format.rfc3164is the older format, which the defaultrsyslogforwarding template, thesyslog-ngnetwork()destination, and most network appliances emit unless configured otherwise. A record that arrives in one format while the listener expects the other isn’t parsed and is forwarded as one opaque line.noneskips parsing and keeps each line as the record body, for a sender that conforms to neither format. Allowed values:rfc5424,rfc3164,none. -
syslog.locationType:string. Optional. Default:UTC. Minimum length:1. Time zone to interpret RFC 3164 timestamps in, as a name from the Internet Assigned Numbers Authority time zone database, such asAmerica/New_York. An RFC 3164 timestamp carries no zone, so without this setting the Collector reads it as UTC, and records from a sender whose clock shows local time get a timestamp that’s off by the zone offset. Set it to the zone the senders use. RFC 5424 timestamps carry their own offset, so this setting doesn’t affect them. The time zone of the host running the Collector isn’t consulted. A name the Collector can’t load stops the listener from starting, and the integration’s listener health reports the failure.