pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedMatching statement and duration log lines
2+ messages / 2 participants
[nested] [flat]
* Matching statement and duration log lines
@ 2017-10-23 13:06 Popov Aleksey <Aleksey.Popov@annalect.omd.ru>
0 siblings, 1 reply; 2+ messages in thread
From: Popov Aleksey @ 2017-10-23 13:06 UTC (permalink / raw)
To: pgsql-general
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?
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [GENERAL] Matching statement and duration log lines
@ 2018-01-29 16:15 Bruce Momjian <bruce@momjian.us>
parent: Popov Aleksey <Aleksey.Popov@annalect.omd.ru>
0 siblings, 0 replies; 2+ messages in thread
From: Bruce Momjian @ 2018-01-29 16:15 UTC (permalink / raw)
To: Popov Aleksey <Aleksey.Popov@annalect.omd.ru>; +Cc: 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 +
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2018-01-29 16:15 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-10-23 13:06 Matching statement and duration log lines Popov Aleksey <Aleksey.Popov@annalect.omd.ru>
2018-01-29 16:15 ` Bruce Momjian <bruce@momjian.us>
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