Line Splitter Message Decoder Module

Converts a single message packed with individual new line delimited messages into multiple messages.

1. Decoder Configuration Table

decoders_moz_logging_line_splitter = {
  -- printf_messages (table/nil) see: https://mozilla-services.github.io/lua_sandbox_extensions/lpeg/modules/lpeg/printf.html
  -- sub_decoder (string/table) see: https://mozilla-services.github.io/lua_sandbox_extensions/lpeg/io_modules/lpeg/sub_decoder_util.html
}

2. Functions

2.1. decode

Decode and inject the resulting message

Arguments

  • data (string) - Raw data from the input sandbox that needs parsing/decoding/transforming
  • default_headers (table/nil/none) - Heka message table containing the default header values to use, if they are not populated by the decoder. If 'Fields' is specified it should be in the hashed based format see: http://mozilla-services.github.io/lua_sandbox/heka/message.html. In the case of multiple decoders this may be the message from the previous input/decoding step.

Return

  • err (nil, string) or throws an error on invalid data or an inject message failure
    • nil - if the decode was successful
    • string - error message if the decode failed (e.g. no match)

source code: line_splitter.lua

results matching ""

    No results matching ""