Mozilla Telemetry JSON Decoder Module
1. Decoder Configuration Table
decoders_moz_ingest_json = {
-- String used to specify the root namespace directory. The path should
-- contain one directory for each namespace. Each namespace directory should
-- contain one directory for each docType and the files in the directory
-- must be named <docType>.<version>.schema.json. If the schema file is not
-- found for a namespace/docType/version combination, an error is generated.
namespace_path = "/mnt/work/mozilla-pipeline-schemas/schemas",
-- array of namespace directories to ignore
-- namespace_ignore = {"heka", "metadata", "pioneer-study", "telemetry"},
-- Transform the User-Agent header into user_agent_browser, user_agent_version, user_agent_os.
-- user_agent_transform = false, -- default
-- Always preserve the User-Agent header if transform is enabled.
-- user_agent_keep = false, -- default
-- Only preserve the User-Agent header if transform is enabled and fails.
-- user_agent_conditional = false, -- default
}
2. Functions
2.1. transform_message
Transform and inject the message using the provided stream reader.
Arguments
- hsr (hsr) - stream reader with the message to process
Return
- throws on error
2.2. decode
Decode and inject the message given as argument, using a module-internal stream reader.
Arguments
- msg (string) - Heka protobuf string to decode
Return
- throws on error
source code: json.lua