logstash-plugins / logstash-output-zabbix

Zabbix output plugin for Logstash 1.5+
Apache License 2.0
24 stars 11 forks source link

Are there any plans to add full property support? #5

Closed aensidhe closed 9 years ago

aensidhe commented 9 years ago

Hello.

I'm trying to send count of exceptions to zabbix. Config is below and it's not working, because metrics stores its output in subfields. I can workaround it, but I think it worth to implement.

input {
    stdin { codec => json }
}

filter {
    if [Exception]
    {
        metrics {
            meter => [ "[@metadata][exception]" ]
            add_tag => [ "metric" ]
            clear_interval => 5
            flush_interval => 5
            periodic_flush => true
            rates => []
            add_field => { "[@metadata][zabbix_key]" => "ExceptionsCount" }
        }
    }
}

output {
    stdout { 
        codec => rubydebug { metadata => true }
    }

    if "metric" in [tags] {
        zabbix {
            zabbix_host => "SomeHost"
            zabbix_server_host => "SomeZabbixServer"
            zabbix_value => "[@metadata][exception][.count]"
            zabbix_key => "[@metadata][zabbix_key]"
        }
    }
}
untergeek commented 9 years ago

This (using subfields) is the canonical way to do it.

When you ask for "full property support," what exactly would you like to see?

aensidhe commented 9 years ago

Hm. It seems I misread docs and all working well. I'm very sorry.