Simple ZeroMQ log forwarder written in go
Base on https://gist.github.com/dstrelau/9824230
Zmqforwarder is base on zeromq 4
, pebbe/zmq4
and ActiveState/tail
.
wget http://download.zeromq.org/zeromq-4.1.3.tar.gz
tar -xzf zeromq-4.1.3.tar.gz
cd zeromq-4.1.3
./configure --prefix=<INSTALL_PREFIX> --enable-static --disable-shared
make install
go get github.com/pebbe/zmq4
go get github.com/ActiveState/tail
To build a static binary:
export CGO_CFLAGS="-I<INSTALL_PREFIX>/include"
export CGO_LDFLAGS="-L/<INSTALL_PREFIX>/lib"
go build -ldflags="-linkmode external -extldflags '-lstdc++ -lpgm -lpthread -static'" zmqforwarder.go