I've written a Go JSON decoder which allows you to configure which JSON fields go into which Heka message struct fields. The rest of the fields get put in the Heka message Fields map. For complex values it leaves the values as JSON-encoded byte slices.
The matching encoder is not yet done, so one of the Heka-included JSON encoders needs to be used, and complex values won't be re-encoded properly. https://github.com/OwnLocal/heka-plugins/blob/master/json_decoder.go On Mon, Aug 3, 2015 at 10:55 AM Nathan Williams <[email protected]> wrote: > yeah, I probably should have spoken up sooner. we already had this one we > were using internally, so i figured i'd clean it up a bit for upstreaming > and do the PR :) > > Cheers, > > Nathan > > On Mon, Aug 3, 2015 at 10:37 AM, Rob Miller <[email protected]> wrote: > >> On 08/03/2015 05:55 AM, Timur Batyrshin wrote: >> >>> Hi, >>> >>> I've looked into these 2-3 implementations of JSON decoders/encoders and >>> found you are right in every word. >>> Sorry for the possible confusion I've caused. >>> >> No problem, you're asking good questions. >> >>> On the other hand I'm worried about complexities which newcomers like me >>> will meet :-) >>> >>> Do you think that sample implementation in examples/docs/contrib will be >>> good for dealing with this? >>> At the same time you won't have to support requests such as mine for >>> contrib stuff. >>> >> As I said, I'm +1 to providing a generic JSON decoder that will be useful >> for folks trying to get started. And, luckily, it seems someone has been >> watching this thread and has already gotten started on an implementation: >> https://github.com/mozilla-services/heka/pull/1653 >> >> -r >> >> >> _______________________________________________ >> Heka mailing list >> [email protected] >> https://mail.mozilla.org/listinfo/heka >> > > _______________________________________________ > Heka mailing list > [email protected] > https://mail.mozilla.org/listinfo/heka >
_______________________________________________ Heka mailing list [email protected] https://mail.mozilla.org/listinfo/heka

