1

我尝试在 logstash 中使用指标失败了,我希望在调试输出中看到的是添加了新标签和新字段的日志。尽管如此,我的日志没有改变,看起来指标根本不起作用。我的 Logstash conf 文件如下所示。你能指出我的错误吗?

input {
  generator {
    type => "generated"
    count => 2
    lines => ["line 1", "line 2", "line 3"]
  }
}

filter {
  metrics {
    type => "generated"
    meter => ["events"]
    add_tag => "metric"
    add_field => [ "status", "All is OK" ]
  }
}

output {
  stdout {
    message => "rate: %{events.rate_1m}"
    debug => true
  }
}

logstash:logstash-1.2.1-flatjar.jar 平台:Debian 3.2.46-1+deb7u1 x86_64

此致

4

1 回答 1

1

This is known to be broken in 1.2.1. https://groups.google.com/forum/#!searchin/logstash-users/metric/logstash-users/JC6GMc9-iZI/rdf6gTSgaDEJ

Looks like fixed in 1.2.2 https://github.com/logstash/logstash/blob/master/CHANGELOG

于 2013-10-15T03:53:04.430 回答