SCM

[#1010944] postgresql 9.0 csvlogs have an extra field

View Trackers | Patches | Download .csv | Monitor

Date:
2010-11-16 16:41
Priority:
3
State:
Open
Submitted by:
Matt Saunders (cm6051)
Assigned to:
Nobody (None)
Category:
Group:
Resolution:
None
 
Summary:
postgresql 9.0 csvlogs have an extra field

Detailed description
Hi Guillaume,

Per http://www.postgresql.org/docs/9.0/static/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-CSVLOG , Postgres 9.0 adds an extra field named "application_name" to the end of each CSV line.

pgfouine cannot parse these currently.

Here is a brief patch to address this problem. It's not very pretty, nor does it make any attempt to process the new application_name information, but it does allow pgfouine to successfully analyse the logs from our 9.0 servers.

Hope this is useful!


Matt.



--- ./include/CsvlogLogReader.class.php.prematts 2010-11-16 07:54:38.000000000 -0800
+++ ./include/CsvlogLogReader.class.php 2010-11-16 07:55:25.000000000 -0800
@@ -32,7 +32,7 @@
while ($csvLine = fgetcsv($filePointer)) {
$lineParsedCounter ++;

- if(count($csvLine) == 22) {
+ if((count($csvLine) == 22) || (count($csvLine) == 23)) {
$lines =& $lineParser->parse($csvLine);

if($lines) {
@@ -59,4 +59,4 @@
}
}

Followup

No Followups Have Been Posted

Attached Files:

Changes:

No Changes Have Been Made to This Item

Powered By FusionForge