Skip to main content
The monitoring agent installed on Compute virtual machines can collect journald logs from systemd services and forward them to Logging. This allows you to centralize and analyze system-level logs from your VMs.

Enable journald log collection

To enable journald log collection, you need to set specific labels on your Compute virtual machine. You can do this when creating a VM or by updating an existing one.
Currently, journald log collection is only supported on standalone Compute VMs.

Configuration labels

Use the following labels to configure journald log collection:
LabelDescriptionExample value
nebius.o11y.systemd-logs-collection.enabledEnables or disables journald log collection.true or false
nebius.o11y.systemd-logs-collection.unitsSpecifies which systemd units to collect logs from. Separate multiple units with semicolons. If not specified, logs from all units are collected.sshd.service;docker.service

How to set labels

When creating a new VM by running nebius compute instance create, include the labels in the .metadata.labels field of your JSON input:
nebius compute instance create \
  --format json \
  - <<EOF
{
  "metadata": {
    "name": "my-vm",
    "labels": {
      "nebius.o11y.systemd-logs-collection.enabled": "true",
      "nebius.o11y.systemd-logs-collection.units": "sshd.service;docker.service"
    }
  },
  "spec": {
    "resources": {
      "platform": "cpu-e2",
      "preset": "2vcpu-8gb"
    },
    "boot_disk": {
      "attach_mode": "READ_WRITE",
      "existing_disk": {
        "id": "<boot_disk_ID>"
      }
    },
    "network_interfaces": [
      {
        "name": "default-subnet",
        "subnet_id": "<subnet_ID>",
        "ip_address": {}
      }
    ]
  }
}
EOF
To update labels on an existing VM, run nebius compute instance update:
nebius compute instance update \
  --id <VM_ID> \
  --labels "nebius.o11y.systemd-logs-collection.enabled=true,nebius.o11y.systemd-logs-collection.units=sshd.service;docker.service"
After updating labels on an existing VM via the CLI or Terraform, you must stop and then start the VM for the changes to take effect.
For more details on creating and managing VMs, see How to create a virtual machine in Nebius AI Cloud.

View collected logs

After configuring journald log collection, you can view the collected logs in Grafana®. For instructions on how to connect and query logs, see How to view logs in Grafana®.

Collected attributes

The monitoring agent extracts the following attributes from journald log entries:
AttributeDescription
SYSTEMD_UNITThe systemd unit that generated the log entry.
syslog.identifierThe syslog identifier of the process.
BOOT_IDA unique identifier for the current boot session.
CAP_EFFECTIVEThe effective capabilities of the process.
SYSTEMD_CGROUPThe control group path of the process.
GIDThe group ID of the process.
PIDThe process ID of the process that generated the log.
UIDThe user ID of the process.
CMDLINEThe command line of the process.
TRANSPORTThe transport mechanism used to deliver the log (e.g., journal, syslog).
STREAM_IDThe stream identifier for stdout/stderr streams.
SYSLOG_FACILITYThe syslog facility number.
SYSLOG_IDENTIFIERThe syslog identifier string.

Data enrichment

In addition to the journald attributes, the monitoring agent enriches log entries with the following metadata:
AttributeDescription
instance_idThe unique identifier of the Compute VM.
container_idThe ID of the VM’s parent project.
mk8s_cluster_idThe Managed Kubernetes cluster ID, if the VM is a cluster node.
mk8s_node_group_idThe Managed Kubernetes node group ID, if the VM is a cluster node.
gpu_cluster_idThe GPU cluster ID, if the VM is part of a GPU cluster.

See also