View logs
Kernel messages can be retrieved withtalosctl dmesg command:
talosctl logs command:
talosctl logs kernel.
Container logs for Kubernetes pods can be retrieved with talosctl logs -k command:
If some host workloads (e.g. system extensions) send syslog messages, they can be retrieved with talosctl logs syslogd command.
Forward logs for aggregation
Talos writes logs to files in/var/log directory.
A pod running in Kubernetes can mount this directory and forward logs to a log aggregation system.
Send logs over network
Service logs
You can enable log sending in machine configuration:json_lines:
msg, talos-level, talos-service, and talos-time fields are always present; there may be additional fields.
Every message sent can be enhanced with additional fields by using the extraTags field in the machine configuration:
extraTags are added to every message sent to the destination verbatim.
syslog is considered a service in Talos, and so messages/logs sent to syslog (e.g., by system extensions) are considered
service logs and will be sent to any configured remote receivers without further configuration.
Kernel logs
Kernel log delivery is configured with theKmsgLogConfig document in the machine configuration:
talos.logging.kernel=tcp://host:5044/ kernel command line argument, which is useful to capture logs from the early boot:
add it to the boot asset with Image Factory or pass it on the command line of the boot loader.
Kernel log destination is specified in the same way as service log endpoint.
The only supported format is json_lines.
Sample message:
KmsgLogConfig is applied to a running node, while a change of the kernel command line only takes effect on the next boot with the updated boot asset.
Receive logs
If you have configured remote service logs or kernel logs on a Talos system and want to collect the logs centrally for debugging purposes you can temporarily run the netcatnc command to receive logs.
On a Linux host run the following command: