Hello!
I'm using logstash to send apache and amavis metrics to statsd. I define all fields that should be sent to statsd but sometimes, some of the fields doesn't exist and I get error on stasd side.
Statsd config:
statsd {
timing => [ "amavis.timeelapsed.amavis", "%{[elapsed][Amavis]}",
"amavis.timeelapsed.decoding", "%{[elapsed][Decoding]}",
"amavis.timeelapsed.receiving", "%{[elapsed][Receiving]}",
"amavis.timeelapsed.sending", "%{[elapsed][Sending]}",
"amavis.timeelapsed.viruscheck", "%{[elapsed][VirusCheck]}",
"amavis.timeelapsed.spamcheck", "%{[elapsed][SpamCheck]}",
"amavis.timeelapsed.total", "%{[elapsed][Total]}" ]
namespace => 'servers'
host => '1.2.3.4'
port => '8125'
}
Sometimes, elapsed.VirusCheck and elapsed.SpamCheck fields doesn't exist. This is when statsd gives me the error:
DEBUG: Bad line: %{[elapsed][Decoding]},ms in msg "servers.amavis.timeelapsed.decoding:%{[elapsed][Decoding]}|ms"
DEBUG: Bad line: %{[elapsed][VirusCheck]},ms in msg "servers.amavis.timeelapsed.viruscheck:%{[elapsed][VirusCheck]}|ms"
How could I force statsd plugin, to not send metrics if the field doesn't exists?
Matej