$linuxjunkies
>

structured log

also: structured logging, JSON logging, semantic logging

A log format where entries are organized into named fields (like timestamp, severity, message) rather than unstructured plain text, making logs easier to parse, search, and analyze programmatically.

Structured logs use a defined format—typically JSON, key=value pairs, or a schema—to organize log data into discrete fields instead of free-form text strings. Each log entry contains labeled data that tools and parsers can reliably extract and process.

For example, instead of a plain-text Apache log line like 192.168.1.100 - - [01/Jan/2024 12:00:00] "GET /api/users HTTP/1.1" 200 512, a structured log might emit: {"timestamp":"2024-01-01T12:00:00Z","ip":"192.168.1.100","method":"GET","path":"/api/users","status":200,"bytes":512}

This enables efficient log aggregation, filtering, alerting, and analysis with tools like jq, ELK Stack, Splunk, or cloud logging platforms. Structured logs are particularly valuable in containerized and microservices environments where correlating events across many sources is critical.

Related terms