summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Langesten <daniel.langest@gmail.com>2015-03-25 13:05:12 +0100
committerDaniel Langesten <daniel.langest@gmail.com>2015-03-25 13:05:12 +0100
commit75182b4948db8260f18a0e594a51e846921e8410 (patch)
tree9411a888004adeafca2f724cc4b9d8b71ee55e36
parentc62d79050b3d1b2cb656d157f3021d649bf8838a (diff)
check so that the string has any length
-rw-r--r--stdin.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/stdin.go b/stdin.go
index 9848476..dd89234 100644
--- a/stdin.go
+++ b/stdin.go
@@ -44,8 +44,8 @@ func parseRawData(in <-chan []byte, cfg *Config) <-chan []RawData {
go func() {
rDat := make([]RawData, 0)
for line := range in {
- if !strings.HasPrefix(string(line), "{") {
- stlogger.Println("Got message:", string(line))
+ if len(string(line)) > 0 && !strings.HasPrefix(string(line), "{") {
+ stlogger.Println("Got message:", strings.TrimSpace(string(line)))
//This should be a break in the output from pmacct
//so we deploy our collected data and set a new timeBin
ival, err := cfg.getInterval()