pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: Popov Aleksey <Aleksey.Popov@annalect.omd.ru>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: [GENERAL] Matching statement and duration log lines
Date: Mon, 29 Jan 2018 11:15:49 -0500
Message-ID: <20180129161549.GD11620@momjian.us> (raw)
In-Reply-To: <HE1PR0201MB205705C9E46632B735943D89B1460@HE1PR0201MB2057.eurprd02.prod.outlook.com>
References: <HE1PR0201MB205705C9E46632B735943D89B1460@HE1PR0201MB2057.eurprd02.prod.outlook.com>

On Mon, Oct 23, 2017 at 01:06:07PM +0000, Popov Aleksey wrote:
> Hello!
> 
> I am sending PG logs to Elasticsearch and want to merge a line with statement
> and a line with duration into one document.
> Having a statement line and a duration line, can I assume that if a session ids
> (%c) of these lines match,
> and numbers of log lines (%l) are consecutive, then the duration line belongs
> to statement line?

Very late reply here, but setting log_min_duration_statement to zero
will give you those on one line, but the statement will only be output
when it completes, rather than when it starts, which is what
log_statement does.

And, yes, using %c to match up lines will work too.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +




view thread (2+ messages)

Message-ID: <20180129161549.GD11620@momjian.us>
Permalink:  ../20180129161549.GD11620@momjian.us/
Also on:    postgresql.org/message-id/20180129161549.GD11620@momjian.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: bruce@momjian.us, Aleksey.Popov@annalect.omd.ru
  Subject: Re: [GENERAL] Matching statement and duration log lines
  In-Reply-To: <20180129161549.GD11620@momjian.us>
  References: <HE1PR0201MB205705C9E46632B735943D89B1460@HE1PR0201MB2057.eurprd02.prod.outlook.com> <20180129161549.GD11620@momjian.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox