[root@master_agent yum.repos.d]# /opt/logstash/bin/logstash -e 'input { stdin{} } output { stdout{} }'OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
Settings: Default pipeline workers: 1Pipeline main started
hello2017-06-27T04:10:21.010Z master_agent hello
hello word 2017-06-27T04:10:48.513Z master_agent hello wordquit2017-06-27T04:11:12.959Z master_agent quitexit2017-06-27T04:11:19.064Z master_agent exit实例2
[root@master_agent yum.repos.d]# /opt/logstash/bin/logstash -e 'input { stdin{} } output { stdout{ codec => rubydebug} }'
[root@master_agent yum.repos.d]# /opt/logstash/bin/logstash -e 'input { stdin{} } output { stdout{ codec => rubydebug} }'OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
Settings: Default pipeline workers: 1Pipeline main started
hello word
{ "message" => "hello word", "@version" => "1", "@timestamp" => "2017-06-27T04:13:14.560Z", "host" => "master_agent"}实例3 不输出在屏幕上,直接记录在es里
[root@master_agent yum.repos.d]# /opt/logstash/bin/logstash -e 'input { stdin{} } output { elasticsearch { hosts => ["172.16.1.201:9200"] } }'OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
Settings: Default pipeline workers: 1Pipeline main started
hello word!!
Pipeline main has been shutdown实例5
[root@master_agent yum.repos.d]# /opt/logstash/bin/logstash -e 'input { stdin{} } output { elasticsearch { hosts => ["172.16.1.201:9200"] } stdout{ codec => rubydebug } }'OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
Settings: Default pipeline workers: 1Pipeline main started
hello fly salt
{ "message" => "hello fly salt", "@version" => "1", "@timestamp" => "2017-06-27T04:32:50.297Z", "host" => "master_agent"}查看web页面记录的内容
[root@master_agent yum.repos.d]# /opt/logstash/bin/logstash -f /etc/logstash/conf.d/logstash.conf OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
Settings: Default pipeline workers: 1Pipeline main started
hao123.com
{ "message" => "hao123.com", "@version" => "1", "@timestamp" => "2017-06-27T05:06:02.695Z", "host" => "master_agent"}input插件
官方链接