trivago/gollum

Syslog consummer panics

luqasz opened this issue · 2 comments

Hi.

I've noticed that syslog parsing crashes while message is sent:

[2017-07-11 21:41:53 CEST]  INFO A wildcard stream configuration only affects the wildcard stream, not all routers PluginID=_generated_stream_* PluginType=router.Broadcast
[2017-07-11 21:41:53 CEST]  INFO We be nice to them, if they be nice to us. (startup)
panic: runtime error: index out of range

goroutine 35 [running]:
github.com/trivago/gollum/core.(*SimpleConsumer).directEnqueue(0xc4200e8540, 0xc420c82000)
	/Users/lkostka/workspace/golang/src/github.com/trivago/gollum/core/simpleconsumer.go:250 +0x2af
github.com/trivago/gollum/core.(*SimpleConsumer).(github.com/trivago/gollum/core.directEnqueue)-fm(0xc420c82000)
	/Users/lkostka/workspace/golang/src/github.com/trivago/gollum/core/simpleconsumer.go:93 +0x34
github.com/trivago/gollum/core.(*SimpleConsumer).EnqueueWithMetadata(0xc4200e8540, 0xc420c6a090, 0x2a, 0x30, 0x0)
	/Users/lkostka/workspace/golang/src/github.com/trivago/gollum/core/simpleconsumer.go:204 +0x9e
github.com/trivago/gollum/core.(*SimpleConsumer).Enqueue(0xc4200e8540, 0xc420c6a090, 0x2a, 0x30)
	/Users/lkostka/workspace/golang/src/github.com/trivago/gollum/core/simpleconsumer.go:198 +0x52
github.com/trivago/gollum/consumer.(*Syslogd).Handle(0xc4200e8540, 0xc420c6a060, 0x4c, 0x0, 0x0)
	/Users/lkostka/workspace/golang/src/github.com/trivago/gollum/consumer/syslogd.go:114 +0x20b
github.com/trivago/gollum/vendor/gopkg.in/mcuadros/go-syslog%2ev2.(*Server).parser(0xc420c10000, 0xc420c56000, 0x4c, 0x10000, 0xc420c66020, 0xf, 0x0, 0x0)
	/Users/lkostka/workspace/golang/src/github.com/trivago/gollum/vendor/gopkg.in/mcuadros/go-syslog.v2/server.go:270 +0x2be
github.com/trivago/gollum/vendor/gopkg.in/mcuadros/go-syslog%2ev2.(*Server).goParseDatagrams.func1(0xc420c10000)
	/Users/lkostka/workspace/golang/src/github.com/trivago/gollum/vendor/gopkg.in/mcuadros/go-syslog.v2/server.go:372 +0x287
created by github.com/trivago/gollum/vendor/gopkg.in/mcuadros/go-syslog%2ev2.(*Server).goParseDatagrams
	/Users/lkostka/workspace/golang/src/github.com/trivago/gollum/vendor/gopkg.in/mcuadros/go-syslog.v2/server.go:377 +0x90

config file:

syslog:
  type: consumer.Syslogd
  address: udp://0.0.0.0:5514
  format: RFC3164

cwlogs:
  type: producer.CloudwatchLogs
  stream: cwlogs
  group: gollum
  streams: syslog

message sent (copied from https://tools.ietf.org/html/rfc3164#section-5.4):
<34>Oct 11 22:14:15 mymachine su: 'su root' failed for lonvick on /dev/pts/8\n

Probably the same as #151. Will check

Yes, same reason.