startLogstash() potentially is called from many goroutines; this is a data race. Create the logshashChan in a func init() and start it there.