Skip to content

Instantly share code, notes, and snippets.

@zined
Created September 18, 2014 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zined/dd479c93c4492fe5ea07 to your computer and use it in GitHub Desktop.
Save zined/dd479c93c4492fe5ea07 to your computer and use it in GitHub Desktop.
test.toml
[hekad]
base_dir = "/tmp"
[TestTcpInput]
type = "TcpInput"
address = ":12345"
parser_type = "token"
delimiter = "\n"
decoder = "TestDecoder"
[TestDecoder]
type = "SandboxDecoder"
filename = "/tmp/test.lua"
@zined
Copy link
Author

zined commented Sep 18, 2014

$ cat /tmp/test.lua
function process_message()
    return 0
end
$

@zined
Copy link
Author

zined commented Sep 18, 2014

$ hekad -config=test.toml &
[1] 6732
$ 2014/09/18 17:16:47 Pre-loading: [TestTcpInput]
2014/09/18 17:16:47 Pre-loading: [TestDecoder]
2014/09/18 17:16:47 Pre-loading: [ProtobufDecoder]
2014/09/18 17:16:47 Pre-loading: [ProtobufEncoder]
2014/09/18 17:16:47 Loading: [TestDecoder]
2014/09/18 17:16:47 Loading: [ProtobufDecoder]
2014/09/18 17:16:47 Loading: [ProtobufEncoder]
2014/09/18 17:16:47 Loading: [TestTcpInput]
2014/09/18 17:16:47 Starting hekad...
2014/09/18 17:16:47 MessageRouter started.
2014/09/18 17:16:47 Input started: TestTcpInput

$ nc -zvvw1 localhost 12345
localhost [127.0.0.1] 12345 (?) open
 sent 0, rcvd 0
2014/09/18 17:16:52 Decoder 'TestTcpInput-127.0.0.1-TestDecoder': stopped

$ nc -zvvw1 localhost 12345
localhost [127.0.0.1] 12345 (?) open
2014/09/18 17:16:54 Decoder 'TestTcpInput-127.0.0.1-TestDecoder': stopped
 sent 0, rcvd 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment