Skip to content

Instantly share code, notes, and snippets.

@bbinet
Last active August 29, 2015 14:16
Show Gist options
  • Select an option

  • Save bbinet/d1d2125cce2710b5c7e1 to your computer and use it in GitHub Desktop.

Select an option

Save bbinet/d1d2125cce2710b5c7e1 to your computer and use it in GitHub Desktop.
Heka v0.9.0 - Dynamic sandboxes
require "circular_buffer"
data = circular_buffer.new(1440, 1, 60) -- message count per minute
local COUNT = data:set_header(1, "Messages", "count")
function process_message ()
local ts = read_message("Timestamp")
data:add(ts, COUNT, 1)
return 0
end
function timer_event(ns)
inject_payload("cbuf", "", data)
end
[Example]
type = "SandboxFilter"
message_matcher = "Type == 'Widget'"
ticker_interval = 60
filename = ""
preserve_data = false
[PlatformDevs]
type = "SandboxManagerFilter"
message_signer = "PlatformDevs"
working_directory = "/tmp/heka/sandbox"
max_filters = 100
[acl_splitter]
type = "HekaFramingSplitter"
[acl_splitter.signer.PlatformDevs_0]
hmac_key = "Platform devs signing key"
[TCP:5565]
type = "TcpInput"
splitter = "acl_splitter"
address = ":5565"
ip_address = ":5565"
[signer]
name = "PlatformDevs"
hmac_hash = "md5"
hmac_key = "Platform devs signing key"
version = 1
$ hekad -config heka.toml
2015/03/02 16:41:13 Pre-loading: [PlatformDevs]
2015/03/02 16:41:13 Pre-loading: [acl_splitter]
2015/03/02 16:41:13 Pre-loading: [TCP:5565]
2015/03/02 16:41:13 Pre-loading: [ProtobufEncoder]
2015/03/02 16:41:13 Loading: [ProtobufEncoder]
2015/03/02 16:41:13 Pre-loading: [TokenSplitter]
2015/03/02 16:41:13 Loading: [TokenSplitter]
2015/03/02 16:41:13 Pre-loading: [HekaFramingSplitter]
2015/03/02 16:41:13 Loading: [HekaFramingSplitter]
2015/03/02 16:41:13 Pre-loading: [NullSplitter]
2015/03/02 16:41:13 Loading: [NullSplitter]
2015/03/02 16:41:13 Pre-loading: [ProtobufDecoder]
2015/03/02 16:41:13 Loading: [ProtobufDecoder]
2015/03/02 16:41:13 Loading: [acl_splitter]
2015/03/02 16:41:13 Loading: [TCP:5565]
2015/03/02 16:41:13 Loading: [PlatformDevs]
2015/03/02 16:41:13 Starting hekad...
2015/03/02 16:41:13 Filter started: PlatformDevs
2015/03/02 16:41:13 MessageRouter started.
2015/03/02 16:41:13 Input started: TCP:5565
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment