I have just forked zbx-statsd from github into ls-zbxstatsd.
The reason for this is that zbx-statsd was not compatible with the format coming from logstash’s statsd output plugin.
Statsd format is simply “key:value|[type]”.
In logstash, “key” is different, and the format becomes “namespace.sender.’whatever you named it in the statsd output plugin’:value|[type]”. Things get more complicated when you need to split an already period-delimited “key” and figure out which part is which. What if the “sender,” which is the zabbix host you want the metrics to be stored under, is a period-delimited FQDN?
This was too much to handle so I added a delimiter. Double semicolons. With this, the format sent from logstash now looks like “namespace.sender;;.’whatever you named it in the statsd output plugin’:value|[type]”. This is much more easy to split.
For now, I strip the namespace altogether. I don’t need it, and while it might be useful later, I couldn’t think of a reason to keep it, so my script expects the default “logstash” and strips that out. If you’re using this script at this time, don’t change the default namespace, or expect to edit the code. Now I’m left with “sender;;.’whatever you named it in the statsd output plugin’:value|[type]”, where:
- sender = zabbix host
- ‘whatever you named it in the statsd output plugin’ = item key
With the double semicolons I can easily separate the zabbix host name from the zabbix key, even if there are many periods in each.
With the resolution of this, it was time for stage two: Automatic item creation.