We don't currently have a generic JSON decoder. Mainly this is b/c generic JSON doesn't map directly to Heka message fields, so generally we encourage folks to spend a few minutes actually thinking about how they'd like their JSON input to be mapped to the Heka message structure.
It would be possible, and is probably a good idea, however, to write one that does this for you automatically. It would have to recurse through the JSON structure, collapsing it into a flat structure that can be represented by Heka message fields. I've opened an issue for it: https://github.com/mozilla-services/heka/issues/1651 -r On 07/31/2015 08:51 AM, Timur Batyrshin wrote:
I've seen that. By "this module" I'm referring to encoder/decoder. On Fri, Jul 31, 2015 at 6:41 PM, Simon Pasquier <[email protected] <mailto:[email protected]>> wrote: On Fri, Jul 31, 2015 at 4:35 PM, Timur Batyrshin <[email protected] <mailto:[email protected]>> wrote: Hi Simon, Thanks for the link! I’ve also already found 2-3 implementations of thirdparty encoders/decoders. I’m just wondering now if this commonly used module should be in stock heka. The cjson Lua library is available in Lua sandboxes out of the box, among with many other libraries [1]. [1] https://github.com/mozilla-services/lua_sandbox#functions-exposed-to-lua-by-the-core-sandbox Kind regards, Timur On 31 Jul 2015 17:24:20, Simon Pasquier <[email protected] <mailto:[email protected]>> wrote: ------------------------------------------------------------------------ Hello Timur, I would advise to go with the Lua sandboxes: they're really easy to write. Look at the documentation for a simple example [1]. HTH, Simon [1] http://hekad.readthedocs.org/en/v0.9.2/sandbox/json_payload_transform.html#json-payload-transform <http://hekad.readthedocs.org/en/v0.9.2/sandbox/json_payload_transform.html#json-payload-transform> On Fri, Jul 31, 2015 at 2:57 PM, Timur Batyrshin <[email protected] <mailto:[email protected]>> wrote: Hi, I can’t find any reference in docs for JSON decoder/encoder. Github issues say that there was a Go-based one but then it was replaced by cjson. Is there a sandbox encoder/decoder for JSON or the way to use cjson without writing lua? Writing the plugin looks easy but I’d like to avoid that while I’m still evaluating heka. Thanks, Timur _______________________________________________ Heka mailing list [email protected] <mailto:[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

