Skip to content
Novus Examples
jsonl479 B

Structured Log — Lone Surrogate Escapes, Intentionally Invalid (jsonl)

Two records containing unpaired \ud800 and \udfff escapes between three well-formed ones, plus a correct surrogate pair for comparison. Intentionally invalid: the escapes are syntactically legal JSON but cannot be encoded as UTF-8, which is where a re-serialising pipeline breaks.

Preview — first 6 linesjsonl
{"ts":"2026-03-17T09:14:32.850Z","level":"info","msg":"valid record before","seq":1}
{"ts":"2026-03-17T09:14:32.970Z","level":"error","msg":"lone high surrogate: \ud800 in the middle","seq":2}
{"ts":"2026-03-17T09:14:33.090Z","level":"error","msg":"unpaired low surrogate: \udfff here","seq":3}
{"ts":"2026-03-17T09:14:33.210Z","level":"info","msg":"valid surrogate pair: \ud83d\ude80","seq":4}
{"ts":"2026-03-17T09:14:33.330Z","level":"info","msg":"valid record after","seq":5}

Specifications

Lines
5
Lone Surrogate Records
2
Valid Surrogate Pair Records
1
Intentionally Invalid
true
Rule
a lone surrogate has no UTF-8 encoding

Testing contract

Expected to fail
Scenario
Parse all five records and re-serialise them as UTF-8.
Expected result
Records 1, 4 and 5 round-trip — including the rocket emoji from the valid surrogate pair — while records 2 and 3 are rejected or replaced with U+FFFD instead of producing invalid UTF-8 output.

What is a .jsonl file?

JSONL (JSON Lines) is a text format where each line is a complete, independent JSON value, allowing records to be streamed and appended without parsing the whole file. It is not itself a JSON array and each line must stand alone. It is common in logging, machine learning datasets, and data pipelines.

How to use this file

Use an example JSONL to test line-by-line streaming parsers, append-and-resume ingestion, and batch pipelines that process one record per line.

How to use this file for testing

“Structured Log — Lone Surrogate Escapes, Intentionally Invalid (jsonl)” is a deterministic Novus Examples fixture for Observability, Encoding detection, Error handling. Structured and plain-text telemetry with known timestamps, levels, request identifiers, and error states for testing log ingestion, correlation, dashboards, and alert pipelines.

Documented properties for this file: JSONL · 479 bytes. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.

Telemetry fixtures use fixed trace IDs, span IDs, and timestamps so ingestion is reproducible run to run. Point your collector, parser, or query layer at the file and assert the documented span tree, metric families, or severity mix; service and host names are invented.

Code examples

import json

with open("app-lone-surrogates.jsonl") as f:
    rows = [json.loads(line) for line in f]
print(len(rows), rows[0])

Generated by generation/observability.py. Free for any use, no attribution required — license.