Skip to content
Novus Examples
jsonl1.8 KB

Structured Log — Blank, Non-JSON and BOM-Prefixed Lines (jsonl)

A JSON Lines file with the debris a real container stream carries: blank and whitespace-only lines, one bare stderr write from a C library, a mid-file byte-order mark and two lines that are valid JSON but not objects. Five real records are in there.

Preview — first 11 linesjsonl
{"ts":"2026-03-17T09:14:32.850Z","level":"error","service":"inventory-api","version":"2.3.0","env":"staging","host":"node-b1","logger":"shop/inventory/reserve","msg":"insufficient stock for reservation","http":{"method":"POST","route":"/api/orders","status":409,"duration_ms":50.32},"request_id":"req-000001","order_id":"ord-2026-0317-005466","seq":1}

{"ts":"2026-03-17T09:14:33.150Z","level":"debug","service":"checkout-api","version":"1.14.2","env":"staging","host":"node-a1","logger":"com.example.shop.checkout.PricingService","msg":"recomputed cart totals","http":{"method":"POST","route":"/api/checkout","status":201,"duration_ms":362.79},"request_id":"req-000002","order_id":"ord-2026-0317-009187","seq":2}
   
this line is not JSON at all — a bare stderr write from a C library
{"ts":"2026-03-17T09:14:33.550Z","level":"info","service":"checkout-api","version":"1.14.2","env":"staging","host":"node-a1","logger":"com.example.shop.checkout.OrderController","msg":"request completed","http":{"method":"POST","route":"/api/checkout","status":201,"duration_ms":95.31},"request_id":"req-000003","order_id":"ord-2026-0317-001239","seq":3}
{"ts":"2026-03-17T09:14:33.950Z","level":"warn","service":"inventory-api","version":"2.3.0","env":"staging","host":"node-b1","logger":"shop/inventory/reserve","msg":"reservation retried after conflict","http":{"method":"POST","route":"/api/orders","status":200,"duration_ms":208.58},"request_id":"req-000004","order_id":"ord-2026-0317-005214","seq":4}
[1, 2, 3]
null
{"ts":"2026-03-17T09:14:34.450Z","level":"info","service":"catalog","version":"0.0.1","env":"staging","host":"node-c1","logger":"shop/catalog/handler","msg":"request completed","http":{"method":"GET","route":"/api/catalog","status":200,"duration_ms":322.49},"request_id":"req-000005","order_id":"ord-2026-0317-001139","seq":5}

Specifications

Lines
10
Valid Object Records
5
Blank Or Whitespace Lines
2
Non Json Lines
1
Bom Prefixed Lines
1
Non Object Json Lines
2

Testing contract

Expected to recover
Scenario
Parse the stream and separate records from noise.
Expected result
Exactly 5 object records are extracted, the BOM-prefixed line is one of them, and the array and null lines are rejected as non-records rather than being indexed as documents.

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 — Blank, Non-JSON and BOM-Prefixed Lines (jsonl)” is a deterministic Novus Examples fixture for Observability, Log parsing, 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 · 1,840 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-mixed-json-and-noise.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.