代码语言:javascript复制
配置
input {
udp {
port => 12000
codec => collectd {}
type => "collectd-demo"
}
}
output {
stdout {
codec => rubydebug
}
}
启动
bin/logstash -f /etc/logstash/conf.d/demo-input-collectd.conf
结果
{
"@timestamp" => 2017-06-13T03:20:19.620Z,
"plugin_instance" => "root",
"type_instance" => "free",
"plugin" => "df",
"host" => "192.168.56.201",
"@version" => "1",
"collectd_type" => "df_complex",
"type" => "collectd-demo",
"value" => 5521645568.0
}
{
"@timestamp" => 2017-06-13T03:20:19.620Z,
"plugin" => "entropy",
"host" => "192.168.56.201",
"@version" => "1",
"collectd_type" => "entropy",
"type" => "collectd-demo",
"value" => 844.0
}