All Tools View Categories About Contact Privacy

Nginx Log to JSON Converter

Parse Nginx access (combined) and error logs into clean JSON records.

Runs entirely in your browser — logs never leave this page.

About Nginx Log to JSON Converter

Nginx writes two very different log files by default: access.log, one line per request in the combined format, and error.log, a free-text stream of worker warnings, upstream failures and connection errors. Neither is JSON, and dashboards, log shippers (Filebeat, Fluent Bit, Logstash) and alerting systems generally want structured records instead of raw text. Nginx Log to JSON Converter parses both halves of the Nginx world — access lines and error lines — into clean, consistent JSON objects in a single paste, entirely in your browser.

Access lines become objects with the remote IP, the authenticated user (when logged), a parsed timestamp, the request split into method / path / protocol, HTTP status, response bytes, Referer, User-Agent, and the X-Forwarded-For chain when your log_format appends it — useful for attributing requests to the real client behind a load balancer or CDN. Error lines are handled by a completely different parser: they map the timestamp, severity (error, warn, notice, crit...), the worker PID and thread ID, the *N connection marker Nginx uses to correlate log lines from the same connection, and the trailing key/value metadata — client, server, request, upstream, host — onto the same flat record shape, with whatever text remains left as the message field. Auto-detect tells access and error lines apart automatically by inspecting the start of each line, so a file that interleaves both (or a paste that mixes an access.log excerpt with a matching error.log excerpt for the same incident) converts correctly in one pass without manual splitting.

Two timestamp dialects are recognized on the access side: the classic Apache-style bracketed time ([10/Oct/2000:13:55:36 -0700]) and the $time_iso8601 variant some configs switch to ([2026-08-15T09:12:33+00:00]); the error log’s own YYYY/MM/DD HH:MM:SS format is parsed separately. All three are converted to a real UTC instant, and you choose how that instant is rendered in the output: ISO 8601 UTC for readability and sorting, Unix milliseconds for time-series tooling, or the original raw Nginx string if you want to keep it verbatim. Output can be a pretty-printed JSON array for reading, a compact single-line array to save space, or JSONL (one JSON object per line) for streaming into jq, a log shipper, or a script that reads line by line. Nothing is uploaded — parsing, timestamp conversion and formatting all happen locally, and the result never leaves the page until you copy or download it.

Features

  • Combined access format: standard Nginx access log lines recognized, including the optional authenticated-user field.
  • X-Forwarded-For support: the third quoted field is captured as x_forwarded_for when your proxy logs it.
  • Error log parsing: severity, worker PID/TID, the *N connection marker, and message metadata (client, server, request, upstream, host) split into their own fields.
  • Dual access timestamps: Apache-style bracketed time and $time_iso8601 both recognized and converted to a real UTC instant.
  • Auto-detect per line: access and error lines mixed in one paste are told apart automatically.
  • Pretty, compact or JSONL: choose the output shape your pipeline wants, with the download filename and extension matching your choice.
  • Placeholder control: skip ‘-’ values entirely or keep them as explicit null.
  • Timestamp output control: ISO 8601 UTC, raw Nginx string, or Unix milliseconds.
  • Sample data: realistic mixed access and error lines in one click.
  • Local processing: everything runs in your browser, nothing uploaded.

How to Use

  1. Paste your logs. Drop Nginx access and/or error lines into the input box, or click Load sample for a ready mix of both.
  2. Choose the parser. Auto-detect handles mixed feeds by inspecting each line; pin Access or Error for a uniform file to get stricter matching.
  3. Pick output options. Select the timestamp format (ISO, raw or Unix), the JSON shape (pretty, compact or JSONL), and whether to drop ‘-’ placeholders or keep them as null.
  4. Convert. Click Convert (or just keep typing — it re-runs as you edit) and a JSON array or JSONL block appears with a record and byte count, plus a list of any lines that failed to parse.
  5. Copy or download. Copy to the clipboard, or download a file whose extension matches the chosen output shape (.json or .jsonl).

Examples

Example 1 — Feed a reverse proxy dashboard. Paste access lines, choose ISO timestamps and JSONL, and stream records into an ingest pipeline with zero field mapping required on the receiving end.

Example 2 — Debug upstream failures. Parse an error.log excerpt like 2026/08/15 09:12:33 [error] 1234#5678: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.1.100, server: example.com, upstream: "http://127.0.0.1:8080/" and get a record with level, client, server and upstream already split out to group by failing backend.

Example 3 — Trace a user through X-Forwarded-For. Convert access logs where the log_format appends a third quoted field, and use the captured x_forwarded_for chain to attribute requests to the real client behind a load balancer or CDN.

Example 4 — Analytics on requests. Turn an access.log excerpt into a JSON array and run jq to rank paths, statuses, agents or IPs without touching raw text with regex by hand.

Example 5 — Testing a log ingestion parser. Build a JSON fixture from real Nginx output to unit-test a log ingestion pipeline, in compact or JSONL form, with placeholders either dropped or explicit null depending on what your test expects.

Example 6 — Mixed incident review. Paste the access lines and the matching error.log lines for the same time window together; auto-detect keeps the two record shapes apart in one combined JSON export for a postmortem.

Benefits

  • No regex setup: patterns for combined access logs and error logs are built in and tested against real Nginx output.
  • Proxy-aware: X-Forwarded-For chains and upstream host/status info are preserved as their own fields.
  • Pipeline-ready: JSON array or JSONL for jq, log shippers and databases, with matching file extensions on download.
  • Mixed-dialect safe: auto-detect keeps access and error lines apart even when pasted together.
  • Timestamp control: ISO 8601, raw Nginx string or Unix milliseconds — whichever your consumer wants.
  • Failed lines surfaced: anything that doesn’t match either format is reported instead of silently dropped.
  • Private by design: data is processed locally and never uploaded.

Frequently Asked Questions

Which Nginx log formats does this support?
Nginx access logs in the default combined format — with optional X-Forwarded-For — using either Apache-style [10/Oct/2000:13:55:36 -0700] or $time_iso8601 timestamps, plus the standard Nginx error.log format.
What fields are extracted from an access line?
Remote IP, optional authenticated user, timestamp, request method/path/protocol, HTTP status, bytes sent, Referer, User-Agent and, when present, the X-Forwarded-For chain.
What does the error log parser extract?
The timestamp, severity level, worker PID and TID, the connection marker (the *N identifier), and the message plus its trailing metadata — client, server, request, upstream and host.
How are timestamps handled?
Apache-style bracketed times and $time_iso8601 strings are both recognized and converted to UTC ISO 8601. You can also keep the raw Nginx string or get Unix milliseconds.
What output shapes are available?
A pretty-printed JSON array, a compact one-line array, or JSONL with one record per line — ready for jq, Logstash, Python or Node pipelines.
Is my data uploaded?
No. Conversion happens entirely in your browser; nothing is sent to a server, stored or logged.