码迷,mamicode.com
首页 > 其他好文 > 详细

ELK之logstash的输入输出-4

时间:2019-04-03 12:51:10      阅读:141      评论:0      收藏:0      [点我收藏+]

标签:RoCE   .com   png   output   debug   cat   elk   pat   ice   

logstash的标准输入输出
[root@elk-node01 logstash]# ./bin/logstash  -e ‘input {  stdin{} } output { stdout{  codec => rubydebug }}‘  
hellow
word    
{
       "message" => "hellow",
          "host" => "elk-node01",
      "@version" => "1",
    "@timestamp" => 2019-04-03T03:20:27.319Z
}
{
       "message" => "word",
          "host" => "elk-node01",
      "@version" => "1",
    "@timestamp" => 2019-04-03T03:20:27.339Z
}

测试输出到文件

 [root@elk-node01 logstash]# ./bin/logstash -e ‘input {  stdin{} } output { file { path =>   "/tmp/hanye-%{+YYYY.MM.dd}"}}‘
hellow
word
[2019-04-03T11:24:59,845][INFO ][logstash.outputs.file    ] Opening file {:path=>"/tmp/hanye-2019.04.03"}
 [root@elk-node01 logstash]# cat /tmp/hanye-2019.04.03
   {"@version":"1","@timestamp":"2019-04-03T03:24:59.555Z","message":"word","host":"elk-node01"}
   {"@version":"1","@timestamp":"2019-04-03T03:24:59.523Z","message":"hellow","host":"elk-node01"}

测试输出到elasticesearch

[root@elk-node01 logstash]# ./bin/logstash -e ‘input {  stdin{} } output { elasticsearch {hosts => ["192.168.1.252:9200"] index => "hanye-%{+YYYY.MM.dd}" }}‘ 
  hellow
  word    

技术图片
技术图片

ELK之logstash的输入输出-4

标签:RoCE   .com   png   output   debug   cat   elk   pat   ice   

原文地址:https://blog.51cto.com/9025736/2373453

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!