Skip to content

Instantly share code, notes, and snippets.

@KushalP
KushalP / json_log_decode.lua
Created January 23, 2014 19:51
Example of a Heka Lua Sandbox decoder that will take JSON log lines (and some extra decoder config) and stream that information into the `Fields` variables of the Heka message.
require "cjson"
-- Generic decoder for JSON logs. This will extract all JSON
-- keys and add them to the `Fields` variable of the created
-- Heka message.
--
-- Example use:
--
-- [NginxJsonLogDecoder]
-- type = "SandboxDecoder"