Skip to content
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.

Commit

Permalink
fix influx bool result
Browse files Browse the repository at this point in the history
  • Loading branch information
ezotrank committed Sep 14, 2014
1 parent c51da19 commit 21a41df
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions logsend/influxdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,22 +78,24 @@ func (self *InfluxdbSender) Send(data interface{}) {
series := &influxdb.Series{
Name: self.name,
}
columns := make([]string, 0)
points := make([]interface{}, 0)
switch data.(type) {
case map[string]interface{}:
columns := make([]string, 0)
points := make([]interface{}, 0)
for key, value := range data.(map[string]interface{}) {
columns = append(columns, key)
points = append(points, value)
}
for _, extraField := range self.extraFields {
if val, err := extendValue(extraField[1]); err == nil {
columns = append(columns, *extraField[0])
points = append(points, val)
}
}

for _, extraField := range self.extraFields {
if val, err := extendValue(extraField[1]); err == nil {
columns = append(columns, *extraField[0])
points = append(points, val)
}
series.Columns = columns
series.Points = [][]interface{}{points}
}
series.Columns = columns
series.Points = [][]interface{}{points}

influxdbCh <- series
}

0 comments on commit 21a41df

Please sign in to comment.