logstash之input配置stdin类型详解

2018-04-28 13:22:32 浏览数 (2)

代码语言: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"
    ]
}

0 人点赞