Glossary · Observability
What Are Structured Logs?
Dilip Namdev
May 2026
4 min read
Structured logs turn log lines from prose you grep into data you can query and correlate.
Structured logs are log records emitted as machine-readable key-value data (often JSON) rather than free-form text, so they can be filtered, aggregated and correlated, for example, linked to a trace by trace ID.
Structured vs unstructured
An unstructured log is a line of text that a human reads and a machine struggles to parse reliably. A structured log carries named fields, timestamp, level, service, trace_id, and any relevant context, so you can filter by field, aggregate counts, and join logs to the traces and metrics they relate to.
Why it matters at scale
At volume, free-text logs are hard to search precisely and impossible to aggregate reliably. Structured fields let you answer questions (how many errors of this type, for this customer, on this version) and, crucially, correlate a log line to the exact trace it belongs to, which is where logs become part of observability rather than a separate silo.
How it fits Opstral
Opstral ingests structured logs alongside metrics and traces, and correlation on shared fields (like trace and resource identifiers) is what lets Sentinel AI assemble a complete picture of an incident.
Frequently asked questions
Should logs include a trace ID?
Yes. Including the trace ID in structured logs lets you jump from a log line to the full trace, which is one of the highest-value correlations in observability.
Is JSON required for structured logging?
No, but JSON is the most common format. The point is named fields a machine can parse, not the specific encoding.