How to parse Logfmt lines
Paste lines into Logfmt input, or choose browse files for a .log or .txt file. The parser keeps each line's field order and repeated keys. Blank lines remain visible in the table, while exports leave them out. Choose a bare-token policy, review warnings, then copy or export the records as CSV, JSON, or JSONL.
- Paste Logfmt or Heroku-style lines into Logfmt input, or choose browse files for a
.logor.txtfile. - Set Bare token policy (tokens with no "=") for tokens without an equals sign.
- Keep Detect leading Heroku-style timestamp + source prefix enabled when the first tokens contain that prefix.
- Check Summary, warnings, selected columns, and the row details.
- Choose Copy JSON, Copy JSONL, or Copy CSV, or use the matching export button.
What Logfmt parsing keeps
Whitespace separates tokens. In status=200 path="/login now", the unquoted value stops at the next space, while the quoted value keeps its space. The parser decodes \" and \\. For another backslash sequence, it keeps the backslash.
key= creates an empty string. Repeated keys stay in input order. JSON and JSONL put each key's values in an array; CSV joins repeated values with | .
at=info status=200 status=201 debug
fields: status=["200", "201"], debug=["true"]
How bare tokens and Heroku prefixes are parsed
A bare token has no =, such as debug. Treat as boolean flag (key=true) adds debug=true as a string. Collect into a "_message" field joins bare tokens in input order. Ignore and warn leaves them out of the fields and adds a warning.
With Detect leading Heroku-style timestamp + source prefix enabled, a first bare token beginning with YYYY-MM-DDTHH:MM:SS becomes the timestamp. The next bare token becomes the source if it ends in :, as in app[web.1]:; the colon is removed. If the first token is not a timestamp, the prefix check does not run.
How Logfmt exports handle types and columns
Values stay strings until Convert plain-integer/decimal values to numbers on export is enabled. Then nonempty values matching a plain integer or decimal pattern become numbers. Empty values and strings with other characters stay strings.
The Record table starts with up to five fields in first-seen order. Change the selected columns in the picker. Expand a row to see every field, the Raw line, and repeated-key positions such as 2 of 3. CSV uses the selected columns. JSON and JSONL retain the line number, raw line, timestamp, source, fields, and warnings.
Use Logfmt Parser with request records
For a line such as method=GET path="/" status=200 bytes=815, select the fields you want in the Record table and copy the result as CSV.
A Heroku-style line can fill the table's Timestamp and Source columns. Expand its row to compare the Raw line with its fields, then check any warning attached to that line.
When another parser fits the input
This page reads Logfmt or Heroku-style key=value lines. Use Cookie Parser for Cookie and Set-Cookie header strings, HTML Table Extractor for tables inside pasted HTML, uploaded HTML, or a public URL, and User-Agent Parser for browser, engine, operating-system, device, and bot details in User-Agent strings. The wider Parser Extract Tools category links to these related parsers.
The page reads selected files with FileReader and builds export files in the browser. Its code does not send log content with a network request. An unterminated quoted value or empty key is kept in the parsed fields and gets a warning; unrelated log formats are not parsed by special rules.
Frequently Asked Questions
How do I parse Logfmt lines?
Paste lines into Logfmt input or choose browse files for a .log or .txt file. Review Summary and the Record table, then copy or export the records.
How does Logfmt Parser handle bare tokens?
Choose Bare token policy (tokens with no "="). The parser can create a string-valued boolean field, collect tokens into _message, or leave them out and add a warning.
Are repeated Logfmt keys preserved in JSON?
Repeated keys remain in input order as arrays in JSON and JSONL exports. Row details show each occurrence, including positions such as 2 of 3.
Can Logfmt Parser parse Heroku log lines?
Enable Detect leading Heroku-style timestamp + source prefix. A leading token matching the timestamp shape becomes timestamp. The next bare token becomes source when it ends in a colon.
Does Logfmt Parser convert values to numbers?
Values remain strings by default. Enable Convert plain-integer/decimal values to numbers on export to convert matching integer and decimal values. Empty values and other strings retain their text.