Heka Sandbox Utility Module
1. Functions
1.1. table_to_fields
Flattens a Lua table so it can be encoded as a protobuf fields object.
Arguments
- hash (table) - table to flatten (not modified)
- fields (table) - table to receive the flattened output
- parent (string) - key prefix
- separator (string) - key separator (default = ".") i.e. 'foo.bar'
- max_depth (number) - maximum nesting before converting the remainder of the structure to a JSON string
Return
- none - in-place modification of
fields
1.2. table_to_message
Converts an arbitrary table into a heka message.
Arguments
- t (table) - input table
- tmap (table, nil) - transformation table
- msg (table, nil) - output table
- parent (string, nil) - key used if processing nested fields ```lua tmap = { time = {header = "Timestamp"}, size = {field = "size", type = "string|bytes|int|double|boolean", representation = "MiB"} }
Return
- msg - table in the Heka message schema format
source code: util.lua