Skip to content

Instantly share code, notes, and snippets.

@corneliusroemer
Created September 15, 2024 17:08
Show Gist options
  • Select an option

  • Save corneliusroemer/98aa1244405f7994d9eb969e2e2678fc to your computer and use it in GitHub Desktop.

Select an option

Save corneliusroemer/98aa1244405f7994d9eb969e2e2678fc to your computer and use it in GitHub Desktop.

Revisions

  1. corneliusroemer created this gist Sep 15, 2024.
    42 changes: 42 additions & 0 deletions postgresCustom2.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,42 @@
    {
    "$schema": "https://lnav.org/schemas/format-v1.schema.json",
    "postgres2": {
    "regex": {
    "duration": {
    "pattern": "^(?<timestamp>\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\.\\d{3} UTC) (?<ip>\\d+\\.\\d+\\.\\d+\\.\\d+)\\((?<port>\\d+)\\) (?<session_id>[^ ]+) (?<transaction_id>\\d+) (?<operation>[A-Z]+) ?(?<level>[A-Z]+)?: (?:duration: (?<dur>\\d+\\.\\d+) ms)?(?<body>.*)$"
    }
    },
    "opid-field": "transaction_id",
    "level-field": "level",
    "body-field": "body",
    "value": {
    "dur": { "kind": "float" },
    "body": { "kind": "string", "identifier": false },
    "ip": {
    "identifier": true,
    "kind": "string"
    },
    "port": {
    "identifier": true,
    "kind": "string"
    },
    "operation": {
    "identifier": true,
    "kind": "string"
    },
    "session_id": {
    "identifier": true,
    "kind": "string"
    },
    "transaction_id": {
    "identifier": true,
    "kind": "string"
    }
    },
    "sample": [
    {
    "line": "2024-09-15 16:05:39.732 UTC 10.42.1.19(46988) 66e70562.51 871 UPDATE LOG: duration: 0.218 ms"
    }
    ]
    }
    }