Re: [GENERAL] Matching statement and duration log lines - Mailing list pgsql-general

From Bruce Momjian
Subject Re: [GENERAL] Matching statement and duration log lines
Date
Msg-id 20180129161549.GD11620@momjian.us
Whole thread Raw
In response to [GENERAL] Matching statement and duration log lines  (Popov Aleksey <Aleksey.Popov@annalect.omd.ru>)
List pgsql-general
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 +


pgsql-general by date:

Previous
From: Steve Crawford
Date:
Subject: Re: Which specific flags to use for bash client applications forDaVinci Resolve?
Next
From: Konstantin Gredeskoul
Date:
Subject: Re: PG Sharding