使用logstash指标,我能够知道每个logstash实例的总事件率。但是,如何判断每种输入类型的事件率。例如,假设我们输入A和输入B.这样的工作会起作用吗?
input {
tcp {
port => 7654
tags => [ "A" ]
}
tcp {
port => 7655
tags => [ "B" ]
}
}
filter {
if "A" in [tags] {
metrics {
meter => "metricsa"
add_tag => "metrics_A"
}
} else if "B" in [tags] {
metrics {
meter => "metricsb"
add_tag => "metrics_B"
}
}
}
output {
if "metrics_A" in [tags] {
graphite {
host => "10.1.1.1"
metrics_format => "test.*"
include_metrics => [ "metricsa.*" ]
fields_are_metrics => true
}
} else if "metrics_B" in [tags] {
graphite {
host => "10.1.1.1"
metrics_format => "test.*"
include_metrics => [ "metricsb.*" ]
fields_are_metrics => true
}
}
}
是否无法为每种输入类型收集摄取指标?