代码语言:javascript复制
配置示例
input {
stdin {
type => "demo-stdin"
add_field => {"test" => "hello"}
codec => "plain"
tags => ["stdin-test"]
}
}
output {
stdout{
codec=>rubydebug
}
}
启动
bin/logstash -f /etc/logstash/conf.d/demo-input-stdin.conf
输入test
返回
{
"@timestamp" => 2017-06-12T07:39:40.278Z,
"test" => "hello",
"@version" => "1",
"host" => "192-168-56-201",
"message" => "test",
"type" => "demo-stdin",
"tags" => [
[0] "stdin-test"
]
}