[heka] use external function

2015-02-13 Thread Djamel F.
Hi, I'm working on a lua sandbox encoder & decoder to dump or load a raw string. So I'm using string.format("%q", "") to escape any special chars in the encoding process. And now I want to do is the opposite in the decoder, I mean unescape the string. So I tried to use the "loadstring" function bu

Re: [heka] use external function

2015-02-13 Thread Michael Trinkala
loadstring is disallowed in the sandbox and that is unlikely to change. There are other ways of decoding it but before we go there what is your use case for creating a string suitable to load into the Lua interpreter? BTW: raw strings will work properly in a Heka message as-is. On Fri, Feb 13, 20

Re: [heka] use external function

2015-02-16 Thread Djamel F.
Here is my use case: I want to serialize (lua sandbox encoder) the messages flowing through heka to some readable log files which are sent to a remote server. The remote server also runs a global heka instance which parses (lua sandbox decoder) the log files coming from many sources. I know that He

Re: [heka] use external function

2015-02-17 Thread Michael Trinkala
If they really need to be text I would use cjson.encode/decode. However, for your use case I would recommend writing the messages out as a Heka protobuf stream and using heka-cat to get at the text representation when you need to. Trink On Mon, Feb 16, 2015 at 1:05 AM, Djamel F. wrote: > Here