I'm trying to use this to count http error code to begin using this plugin. But I got some error, so have you some good example ?
I have this kind of errors in logstash logs:
[2017-07-06T15:30:48,394][WARN ][logstash.outputs.zabbix ] Zabbix server at localhost rejected all items sent. {:zabbix_host=>"xxxxxxx"}
I have this in filter type:
if [response] >= 400 {
mutate {
add_field => {
"[@metadata][error]" => "error[%{response},]"
}
add_field => {
"[@metadata][counter]" => "1"
}
}
}
and this for output:
if [type] == "nginx" {
if [response] >= 400 {
zabbix {
zabbix_server_host => "localhost"
zabbix_host => "host"
zabbix_key => "[@metadata][error]"
zabbix_value => "[@metadata][counter]"
}
}
}
On localhost I have zabbix proxy and logstash. I try a simple zabbix_sender with same parameter and it's working.