diff --git a/outputs/riemann/riemann.go b/outputs/riemann/riemann.go index 789e096911f41..9307218c86d28 100644 --- a/outputs/riemann/riemann.go +++ b/outputs/riemann/riemann.go @@ -14,7 +14,7 @@ type Riemann struct { URL string Transport string - client raidman.Client + client *raidman.Client } var sampleConfig = ` @@ -31,7 +31,7 @@ func (r *Riemann) Connect() error { return err } - r.client = *c + r.client = c return nil } @@ -68,10 +68,9 @@ func (r *Riemann) Write(points []*client.Point) error { return nil } -func buildEvent(p *client.Point) raidman.Event { - host := p.Tags()["host"] - - if len(host) == 0 { +func buildEvent(p *client.Point) *raidman.Event { + host, ok := p.Tags()["host"] + if !ok { hostname, err := os.Hostname() if err != nil { host = "unknown" @@ -86,7 +85,7 @@ func buildEvent(p *client.Point) raidman.Event { Metric: p.Fields()["value"], } - return *event + return event } func init() {