From 1a7340bb0241b57023ecb672af19019cb6bb22e4 Mon Sep 17 00:00:00 2001 From: Mika Eloranta Date: Mon, 25 Apr 2016 16:27:23 +0300 Subject: [PATCH] postgresql_extensible: fix nil field values nil field values would break the output influxdb line procotol. Skip them from the output. --- .../inputs/postgresql_extensible/postgresql_extensible.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/inputs/postgresql_extensible/postgresql_extensible.go b/plugins/inputs/postgresql_extensible/postgresql_extensible.go index cd6fa8cc4..710e537c3 100644 --- a/plugins/inputs/postgresql_extensible/postgresql_extensible.go +++ b/plugins/inputs/postgresql_extensible/postgresql_extensible.go @@ -4,6 +4,7 @@ import ( "bytes" "database/sql" "fmt" + "log" "regexp" "strings" @@ -259,9 +260,11 @@ func (p *Postgresql) accRow(meas_name string, row scanner, acc telegraf.Accumula var isATag int fields := make(map[string]interface{}) for col, val := range columnMap { + if acc.Debug() { + log.Printf("postgresql_extensible: column: %s = %T: %s\n", col, *val, *val) + } _, ignore := ignoredColumns[col] - //if !ignore && *val != "" { - if !ignore { + if !ignore && *val != nil { isATag = 0 for tag := range p.AdditionalTags { if col == p.AdditionalTags[tag] {