Hi,
I wanted to see how rate at which the clients were sending logs to logstash. I wanted to use the metric filter plugin. And it is working. Except one thing. Here is the conf:
input
{
http
{
port => 9999
codec => json
id => "demo"
type => "counted"
tags => "http"
}
}
filter
{
split
{
field => "events"
}
metrics
{
meter => "events"
add_tag => "metric"
add_field => { "hostname" => "%{host}"}
}
}
output
{
if "metric" in [tags]
{
stdout
{
codec => line
{
format => "host:%{hostname}, count_9999: %{[events][count]}, rate_1m: %{[events][rate_1m]}"
}
}
}
else
{
elasticsearch
{
hosts => "http://starkindustries:9455"
ilm_enabled => "true"
ilm_rollover_alias => "test"
ilm_pattern => "000001"
ilm_policy => "test_policy"
user => 'tony'
password => 'pepper'
}
}
}
I am getting output like:
host:%{host}, count_9999: 17, rate_1m: 3.128151
I think I am missing something here.