Monitoring
Solutions
Resources
Free Tools
Pricing
Free Tools / Logs & parsing / JSON Log Flattener

JSON Log Flattener

Paste JSON log lines — one object per line, or an array. Every nested field becomes a dotted key, and the whole set can be exported as flat JSON lines or a CSV you can open in a spreadsheet.

Runs entirely in your browser — nothing you enter here is sent to a server.

Why flatten JSON logs

Structured logs are nested by design: an HTTP request is an object, the user is another, labels are an array. That is good for the application writing them and awkward for almost everything that reads them. Spreadsheets want columns, grep and awk want one value per field, and many log stores index nested objects as dotted field names anyway — so http.status is the name you end up querying.

Flattening walks each record and turns every leaf value into a top-level key built from its path. {"http":{"status":502}} becomes {"http.status":502}. Once every record is flat, the set of all keys becomes the header of a table, and the logs can be exported as CSV.

Analyse in a spreadsheet

Export a few hundred lines as CSV and pivot by status, path or customer without writing a query.

Find the field name

See the exact dotted path your log platform will use for a nested field before you build a dashboard on it.

Spot schema drift

"Sparse fields" counts keys missing from some records — often a sign that two services log the same thing differently.

Convert to logfmt

The key=value output works with tools that expect logfmt, and reads well in a terminal.

Arrays and other edge cases

Arrays have no single right answer. Indexing (tags.0, tags.1) keeps everything but creates a column per position; joining puts the values in one cell, which is what you want for a list of labels; keeping the JSON text preserves arrays of objects intact. Empty objects and arrays are kept as {} and [] so they do not silently disappear, and a key that already contains the separator will look like a nested path — choose another separator if your field names contain dots.

Frequently asked questions

What is NDJSON?

Newline-delimited JSON, also called JSON Lines or JSONL: a text file with one complete JSON object per line. It is the usual format for structured application logs.

How do I convert JSON logs to CSV?

Paste the log lines, choose CSV as the output and download the file. Nested fields become columns named by their path, and records without a field get an empty cell.

How are nested arrays handled?

You choose: each element as its own key with an index, all elements joined into one value, or the array kept as JSON text. Joining is the most practical for CSV.

Is there a size limit?

The work happens in your browser's memory, so several megabytes of logs are fine. For very large files use a command-line tool such as jq on the server instead.

Related free tools

A calculator answers once. Monitoring answers every minute.

Upzilla checks your sites, servers and APIs around the clock and alerts you the moment something breaks. 10 monitors free, no card required.

Start monitoring free →