CBUF Librato EncoderΒΆ

New in version 0.8.

Plugin Name: SandboxEncoder
File Name: lua_encoders/cbuf_librato.lua

Extracts data from SandboxFilter circular buffer output messages and uses it to generate time series JSON structures that will be accepted by Librato’s POST API. It will keep track of the last time it’s seen a particular message, keyed by filter name and output name. The first time it sees a new message, it will send data from all of the rows except the last one, which is possibly incomplete. For subsequent messages, the encoder will automatically extract data from all of the rows that have elapsed since the last message was received.

The SandboxEncoder preserve_data setting should be set to true when using this encoder, or else the list of received messages will be lost whenever Heka is restarted, possibly causing the same data rows to be sent to Librato multiple times.


  • message_key (string, optional, default “%{Logger}:%{payload_name}”)

    String to use as the key to differentiate separate cbuf messages from each other. Supports message field interpolation.

Example Heka Configuration

type = "SandboxEncoder"
filename = "lua_encoders/cbuf_librato.lua"
preserve_data = true
  message_key = "%{Logger}:%{Hostname}:%{payload_name}"

type = "HttpOutput"
message_matcher = "Type == 'heka.sandbox-output && Fields[payload_type] == 'cbuf'"
encoder = "cbuf_librato_encoder"
address = ""
username = ""
password = "SECRET"
    Content-Type = ["application/json"]

Example Output