logstash/logstash — pull request #795 by bfritz (2013-11-22 19:33:13+00:00)
Title: improve oldlogstashjson codec

A few changes here:

* simplify `decode()` by adding a map of v0 to v1 event properties
* fix misguided `encode()` since `source_host` and `@type`, `@tags` and `@source_path` don't (typically) exist in v1 events
* encode "extra" values from v1 events into v0 `@fields` where "extra" is anything not explicitely mapped

Would appreciate second opinion on adding the newline during encode in f5330f2.

Also, `encode()` may be less performant due to the `Hash.has_value?` lookup within loop. I didn't measure to know for sure.

Ref #788