Skip to content
Sections
LanguageRUEN

v1.8Introduction

Formats (v1)

The three formats of the 1.x branch: nginx, logfmt and syslog, and the limits compared with v2.

Version 1 ships three formats. There is no json-lines and no custom patterns; those arrived in version 2.

FormatSamplerec.data
nginx10.0.0.7 - - [01/Oct/2026:09:14:07 +0000] "GET / HTTP/1.1" 200 512ip, method, path, status, bytes
logfmtlevel=warn msg="slow" ms=812all pairs
syslog<34>Oct 1 09:14:07 host app: texthost, app

Limits#

  • Time is always UTC, even when no zone is given.
  • syslog uses the current year.
  • logfmt values stay strings: rec.data.ms is '812', not 812.

A custom format through a function#

If your format is not listed, pass a parsing function:

js
const parser = sverlo.parser({
  format: (line) => {
    const m = /^(\S+) (\w+) (.*)$/.exec(line);
    return m ? { time: m[1], severity: m[2].toUpperCase(), message: m[3], data: {} } : null;
  }
});

The function must return a record object or null. A regular expression with nested quantifiers can hang on a long line, which is why v2 replaced regular expressions with patterns.

Updated: