安装: 略
前台展示:
/opt/logstash/bin/logstash -e 'input { stdin{} } output { elasticsearch{ hosts => ["192.168.56.11:9200"] } }'
从键盘标准输入,写到ES里
![](https://images2018.cnblogs.com/blog/1370697/201804/1370697-20180424091706198-270272709.jpg)
去到elasticWEB端会发现
![](https://images2018.cnblogs.com/blog/1370697/201804/1370697-20180424091723263-1315492194.jpg)
点击数据浏览---->logstash
![](https://images2018.cnblogs.com/blog/1370697/201804/1370697-20180424091738003-71801927.jpg)
可以发现我们的数据写到ES里面了
当然也可以同时写到多个地方,这样就可以同时写到标准输出也同时写到ES里面
/opt/logstash/bin/logstash -e 'input { stdin{} } output { elasticsearch{ hosts => ["192.168.56.11:9200"] } stdout { code => rubydebug } }'