logstash-plugins / logstash-input-gelf

Apache License 2.0
20 stars 39 forks source link

Accept \0 as field separator as per graylog's GELF sender #29

Open viq opened 8 years ago

viq commented 8 years ago

Currently Logstash cannot receive GELF from Graylog, dying with message like:

{:timestamp=>"2015-12-14T12:36:45.543000+0000", :message=>"gelf listener died", :exception=>#<LogStash::Json::ParserError: Illegal character ((CTRL-CHAR, code 0)): only regular white space (\r, \n, \t) is allowed between tokens at [Source: [B@6d13ed25; line: 1, column: 691]>, :backtrace=>["/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.1.1-java/lib/logstash/json.rb:41:in `jruby_load'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-gelf-2.0.2/lib/logstash/inputs/gelf.rb:99:in `udp_listener'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-gelf-2.0.2/lib/logstash/inputs/gelf.rb:63:in `run'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.1.1-java/lib/logstash/pipeline.rb:206:in `inputworker'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.1.1-java/lib/logstash/pipeline.rb:199:in `start_input'"], :level=>:warn}

Related issue is https://github.com/Graylog2/gelfclient/issues/20

ArthurasJ commented 8 years ago

Occurs for me also. I'm using Log4j2 GelfAppender to send log messages to logstash. The same error occurs. Is it possible to overcome this problem somehow?