Reference#
Log format standards, field reference, and service URLs.
SKA Log Message Format#
All processes running in containers must log to stdout.
Log messages must conform to this format for ingestion:
VERSION "|" TIMESTAMP "|" SEVERITY "|" [THREAD-ID] "|" [FUNCTION] "|" [LINE-LOC] "|" [TAGS] "|" MESSAGE LF
Field definitions:
Field |
Required |
Description |
|---|---|---|
VERSION |
Yes |
Version of SKA log standard (1-2 digits, starts at 1) |
TIMESTAMP |
Yes |
ISO8601 timestamp in UTC (e.g., |
SEVERITY |
Yes |
Log level: DEBUG, INFO, WARNING, ERROR, or CRITICAL |
THREAD-ID |
No |
Thread identifier (e.g., “MainThread”, “Thread-1”) |
FUNCTION |
No |
Full namespace of function (e.g., |
LINE-LOC |
No |
Filename and line number (e.g., |
TAGS |
No |
Comma-separated key:value pairs (e.g., |
MESSAGE |
Yes |
UTF-8 encoded message content |
Format examples#
1|2019-12-31T23:12:37.526Z|INFO||testpackage.testmodule.TestDevice.test_fn|test.py#1|tango-device:my/dev/name| Regular information logged here
1|2019-12-31T23:45:42.328Z|DEBUG||testpackage.testmodule.TestDevice.test_fn|test.py#150|| x = 67, y = 24
1|2019-12-31T23:49:53.543Z|WARNING||testpackage.testmodule.TestDevice.test_fn|test.py#16|| z is unspecified, defaulting to 0!
1|2019-12-31T23:50:17.124Z|ERROR||testpackage.testmodule.TestDevice.test_fn|test.py#165|site:Element| Could not connect to database!
1|2019-12-31T23:51:23.036Z|CRITICAL||testpackage.testmodule.TestDevice.test_fn|test.py#16|| Invalid operation. Cannot continue.
Logging levels#
Map Python logging levels to RFC5424 (syslog):
Python |
RFC5424 |
Numerical Code |
|---|---|---|
DEBUG |
Debug |
7 |
INFO |
Informational |
6 |
WARNING |
Warning |
4 |
ERROR |
Error |
3 |
CRITICAL |
Critical |
2 |
Parsing strategies#
Split by delimiter:
log_line = "1|2019-12-31T23:50:17.124Z|ERROR||my.module.func|test.py#165||Cannot connect to database"
structured_log = log_line.split('|')
log_level = structured_log[2] # "ERROR"
Regex with named capture:
^(?<version>\d+)[|](?<timestamp>[0-9TZ\-:.]+)[|](?<level>[\w\s]+)[|](?<thread>[\w-]*)[|](?<function>[\w\-.]*)[|](?<lineloc>[\w\s.#]*)[|](?<tags>[\w\:,-]*)[|](?<message>.*)$
Test at: https://rubular.com/r/e0njVOGCN59mtA
Log field reference#
Use these fields to filter logs in Kibana or query Elasticsearch locally.
Kubernetes fields:
Field |
Description |
|---|---|
|
Kubernetes namespace |
|
Pod name |
|
StatefulSet name (useful for Device Servers) |
|
Container name |
|
Node name |
SKA infrastructure fields:
Field |
Description |
|---|---|
|
Datacentre (e.g., stfc-techops, mid-itf) |
|
Environment (e.g., production) |
|
Log source (syslog, journald, docker, podman, kubernetes) |
SKA CI/CD fields (prefix with kubernetes.labels. or kubernetes.namespace_labels.):
Field |
Description |
|---|---|
|
GitLab project ID |
|
GitLab project name |
|
Sanitised GitLab project path |
|
Author name |
|
Author GitLab ID |
|
SKA team (from People’s database) |
|
Commit SHA |
|
Branch name |
|
GitLab pipeline ID |
|
GitLab job ID |
|
GitLab job name |
|
Merge request ID (if applicable) |
|
GitLab environment tier |
|
Pipeline trigger source |
SKA custom log fields:
Field |
Description |
|---|---|
|
Log severity level |
|
Dynamic log message tags |
Log parsing pipelines#
Before Elasticsearch indexes a log, the document passes through an ingest pipeline that turns raw log text into the structured, searchable fields below and strips sensitive data. Two pipelines run at SKAO, both defined in the ska-ser-ansible-collections repository.
SKA log parsing pipeline#
The ska_log_parsing_pipeline
grok-parses the pipe-delimited SKA Log Message Format from the message and
log fields and produces:
Field |
Source |
Description |
|---|---|---|
|
message / log |
SKA log format version |
|
message / log |
Log timestamp (ISO8601, UTC) |
|
message / log |
Log level (DEBUG, INFO, WARNING, ERROR, CRITICAL) |
|
message / log |
Thread identifier |
|
message / log |
Fully-qualified function name |
|
message / log |
Filename and line number |
|
message / log |
Raw comma-separated |
|
message / log |
The log message body |
|
|
Each tag expanded into its own field (e.g. |
|
|
Nested object parsed from a JSON |
|
message / log |
Transaction id extracted from |
|
derived |
|
|
derived |
|
|
derived |
Set to |
Redaction: To meet GDPR and security requirements, the pipeline removes email
addresses, IPv4 addresses, Bearer tokens, passwords and API keys, passkeys,
curl -u credentials, connection-string credentials, usernames, and GitLab user
metadata from container labels — across the message, log, and
ska_message fields. Host bash_history audit logs (is_audit_log) are
exempt so the audit trail stays intact.
Kubernetes audit pipeline#
The ska_k8s_audit_pipeline
parses Kubernetes audit.k8s.io JSON events and maps them onto common fields:
Field |
Source (audit JSON) |
Description |
|---|---|---|
|
|
Target namespace |
|
|
Resource type |
|
|
Resource name |
|
|
API version |
|
|
API verb (get, create, delete, …) |
|
|
User that made the request |
|
|
Source IP address |
|
|
HTTP response code |
|
|
Requested URI |
Service URLs#
Services vary by datacentre. Production environments do not expose every service.
Grafana monitoring for every datacentre is at monitoring.skao.int.
Logging services — CI/CD datacentres:
Datacentre |
Kibana |
Elasticsearch |
|---|---|---|
|
|
|
|
|
Logging services — ITF and production datacentres:
Datacentre |
Kibana |
Elasticsearch |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
Note
When STFC is down for maintenance, find logging on aws-cicd in Kibana.
Central logging filter values — CI/CD datacentres:
Datacentre |
ska.datacentre |
ska.environment |
ska.prometheus_datacentre |
|---|---|---|---|
|
stfc-techops |
production |
stfc-ska-monitor |
|
stfc-dp |
production |
stfc-dp-ska-monitor |
Central logging filter values — ITF and production datacentres:
Datacentre |
ska.datacentre |
ska.environment |
ska.prometheus_datacentre |
|---|---|---|---|
|
mid-itf |
production |
mid-itf-monitor |
|
low-itf |
production |
low-itf-monitor |
|
psi-mid |
production |
psi-mid-monitor |
|
digital-signal-psi |
production |
N/A |