From 92b7145971f648a42b28eea860d1a61765290433 Mon Sep 17 00:00:00 2001 From: Tim Stack Date: Thu, 17 Aug 2023 21:59:21 -0700 Subject: [PATCH] [formats] add vpostgres_log definition --- src/formats/formats.am | 1 + src/formats/vpostgres_log.json | 50 ++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 src/formats/vpostgres_log.json diff --git a/src/formats/formats.am b/src/formats/formats.am index 9b3d8a95..66b0ab31 100644 --- a/src/formats/formats.am +++ b/src/formats/formats.am @@ -42,5 +42,6 @@ FORMAT_FILES = \ $(srcdir)/%reldir%/vmw_log.json \ $(srcdir)/%reldir%/vmw_vc_svc_log.json \ $(srcdir)/%reldir%/vmw_py_log.json \ + $(srcdir)/%reldir%/vpostgres_log.json \ $(srcdir)/%reldir%/xmlrpc_log.json \ $() diff --git a/src/formats/vpostgres_log.json b/src/formats/vpostgres_log.json new file mode 100644 index 00000000..52a60181 --- /dev/null +++ b/src/formats/vpostgres_log.json @@ -0,0 +1,50 @@ +{ + "$schema": "https://lnav.org/schemas/format-v1.schema.json", + "vpostgres_log": { + "description": "Format for vpostgresql log files with format '%m %c %x %d %u %r %p %l'", + "url": [ + "https://www.postgresql.org/docs/current/runtime-config-logging.html#GUC-LOG-LINE-PREFIX" + ], + "regex": { + "std": { + "pattern": "(?\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\.\\d{3} \\S+) (?[^ ]*) (?[^ ]*) (?[^ ]*) (?[^ ]*) (?[^ ]*) (?[^ ]+) (?\\d+)(?[^:]+):\\s+(?.*)" + } + }, + "opid-field": "session_id", + "value": { + "db_name": { + "kind": "string", + "identifier": true + }, + "pid": { + "kind": "string", + "identifier": true + }, + "remote_pair": { + "kind": "string", + "identifier": true + }, + "session_id": { + "kind": "string", + "identifier": true + }, + "transaction_id": { + "kind": "string", + "identifier": true + }, + "user": { + "kind": "string", + "identifier": true + }, + "num_line": { + "kind": "integer", + "foreign-key": true + } + }, + "sample": [ + { + "line": "2023-07-25 02:14:09.790 UTC 64bf2ff1.21fc1e 0 VCDB vumuser [local] 2227230 5LOG: disconnection: session time: 0:00:00.012 user=vumuser database=VCDB host=[local]" + } + ] + } +}