cancel
Showing results for 
Search instead for 
Did you mean: 

TopMemoryContext logging without timestamp

Level 3 Adventurer

TopMemoryContext logging without timestamp

Some config changes are being testing in my environment regarding memory. With the changes in place, we're having memory issues, and PostgreSQL is throwing TopMemoryContext errors into the logs.  Unfortuantely, these do not start with a timestamp, so my Logstash grok filters are having a bad time with it.


Is there a config setting to configure the TopMemoryContext message to be formatted in the same way as the rest of the messages?


Samples below of multiple lines, starting with one that is parsed properly

 

2018-09-06 11:29:49 EDT [191288]: [1-1] user=enterprisedb,db=public,app=[unknown],client=127.0.0.1 FATAL:  out of memory
2018-09-06 11:29:49 EDT [191288]: [2-1] user=enterprisedb,db=public,app=[unknown],client=127.0.0.1 DETAIL:  Failed on request of size 160.
TopMemoryContext: 150144 total in 6 blocks; 60848 free (6 chunks); 89296 used
  pgstat TabStatusArray lookup hash table: 8192 total in 1 blocks; 1672 free (0 chunks); 6520 used
  TopTransactionContext: 8192 total in 1 blocks; 7960 free (1 chunks); 232 used
    TopTransactionContextResetAtSPLCommit: 0 total in 0 blocks; 0 free (0 chunks); 0 used
  RowDescriptionContext: 8192 total in 1 blocks; 7112 free (0 chunks); 1080 used
  MessageContext: 24576 total in 2 blocks; 14688 free (2 chunks); 9888 used
...
3 REPLIES
EDB Team Member

Re: TopMemoryContext logging without timestamp

Hi lgwapnitsky

 

TopMemoryContext errors is releated to message called Detail: Failed on request of size 160 so it is having timestamp 

2018-09-06 11:29:49 EDT [191288]: [2-1] user=enterprisedb,db=public,app=[unknown],client=127.0.0.1 DETAIL:  Failed on request of size 160.

 And also could you please check %t %m values are set in your log_line_prefix parameter in postgresql.conf file.

 

Hope this helps you.

Level 3 Adventurer

Re: TopMemoryContext logging without timestamp

Got it. So this may need yet another grok in logstash, then. One that handles the multiline and tabs for postgresql logs.


Thank you. I will keep you posted.

 

EDB Team Member

Re: TopMemoryContext logging without timestamp

Hi lgwapnitsky.

 

Thank you for the update. We will wait for your response.