Crash: JSON::GeneratorError: source sequence is illegal/malformed utf-8

Description

It looks like LogStash crashes when illegal content comes in.

Maybe it's possible to trap error, log and ignore data so LogStash continues to work?

Otherwise something similar to $str !~ s/[^[:ascii:]]//g would also do the job

In this case it appeared to be the copyright symbol which caused the problem

]
W, [2011-11-30T10:50:59.100000 #32204] WARN – runner.class: [
[0] "Trouble converting event to JSON",
[1] #<JSON::GeneratorError: source sequence is illegal/malformed utf-8>,
[2] {
"@source" => "file://xxxxxx",
"@type" => "xxxxx",
"@tags" => [],
"@fields" => {},
"@timestamp" => "2011-11-30T09:50:59.093000Z",
"@source_host" => "xxxxx",
"@source_path" => "xxxxxxx",

Gliffy Diagrams

Activity

Show:

Philippe Weber July 9, 2012 at 6:46 AM

CanBeClosed
At reporter request. Seems 1.1.0 came with a fix for this.

Jelle Smet April 24, 2012 at 9:45 AM

Please close this ticket, I can't replicate the problem anymore.

Former user January 1, 2012 at 6:12 PM

Could you attach a file with the offending line in it?

Fixed

Details

Assignee

Reporter

Labels

Affects versions

Created November 30, 2011 at 1:40 PM
Updated April 19, 2013 at 8:19 PM
Resolved August 21, 2012 at 6:27 AM