Skip to content

Instantly share code, notes, and snippets.

View taotetek's full-sized avatar
💭
Left for Gitlab. Microsoft still contracts with ICE.

taotetek taotetek

💭
Left for Gitlab. Microsoft still contracts with ICE.
View GitHub Profile
if $programname startswith 'haproxy' then {
action(
name="haproxy_tcp"
type="omfwd"
protocol="tcp"
target="someserver.digitalocean.com"
port="514"
)
action(
action(
name="to_local_file"
type="omfile"
ziplevel="4"
template="custom_fileformat"
dynafile="custom_filename"
)
@taotetek
taotetek / fun.c
Created February 27, 2017 01:08
CZMQ code instrumented with Prometheus via Go shared lib.
#include <stdio.h>
#include <czmq.h>
#include "prometheuz.h"
void *sender(void *arg) {
zsock_t *sender = zsock_new_push ("inproc://demo");
while (1) {
zstr_send (sender, "hello");
}
}
@taotetek
taotetek / scatter_gather_results.txt
Created December 24, 2016 15:06
GoCZMQ Scatter Gather Test
BenchmarkScatterGather1k-8 1000000 1995 ns/op 513.18 MB/s
BenchmarkScatterGather4k-8 500000 3365 ns/op 1217.08 MB/s
BenchmarkScatterGather16k-8 200000 6394 ns/op 2562.20 MB/s
PASS
GO VERSION 1.7 - BENCHMARKING zeromq/goczmq
--------------------------------------------
go version
go version go1.7.1 linux/amd64
BenchmarkChanneler-8 200000 5371 ns/op 190.64 MB/s
BenchmarkPollerSendFrame1k-8 500000 2863 ns/op 357.62 MB/s
BenchmarkPollerSendFrame4k-8 300000 4063 ns/op 1008.04 MB/s
BenchmarkPollerSendFrame16k-8 200000 8259 ns/op 1983.66 MB/s
BenchmarkProxySendFrame1k-8 1000000 2328 ns/op 439.78 MB/s

Keybase proof

I hereby claim:

  • I am taotetek on github.
  • I am taotetek (https://keybase.io/taotetek) on keybase.
  • I have a public key whose fingerprint is D2D4 E077 E060 6F84 CABF 4FA2 4905 9E02 3498 810F

To claim this, I am signing this object:

module(
load="imczmq"
)
input(
type="imczmq"
endpoints="@tcp://*:24555"
socktype="PULL"
rule="testme"
)
module(
load="imczmq"
)
input(
type="imczmq"
endpoints="@tcp://*:24555"
socktype="PULL"
)
input(type="imfile" File="/var/log/myfile.log" ruleset="myrule")
ruleset(name="myrule) {
<actions here>
}
ruleset(name="kafka_publish_raw") {
action(
name="to_kafka"
type="omkafka"
broker=["prod-kafka01",
"prod-kafka02",
"prod-kafka03"]
topic="rawlogs"
confParam=["socket.keepalive.enable=true","socket.timeout.ms=1000"]
partitions.auto="on"