首页 > 其他 > 详细

ELK 2 – 熟悉配置

时间:2016-08-26 10:25:33      阅读:266      评论:0      收藏:0      [点我收藏+]

ELK中,主要关心logstash的配置,es只是作为存储容器。

logstash

2、rubydebug格式输出

./bin/logstash -e ‘input{stdin{}}output{stdout{codec=>rubydebug}}‘

技术分享

3、配置文件 输出到elasticsearch

配置项

input、filter、output

命令

[elk@linux2 elasticsearch-2.3.5]$ ./bin/logstash agent -f my.conf

my.conf 内容

input {

file {

      path => "/export/servers/apache-tomcat-7.0.70/logs/my.log"

       start_position => "beginning"

       }

}

output {

    elasticsearch {hosts => "localhost" }  //这里可以加上端口号9200

}

 

读取位置

start_position => "beginning"/"end"  每次从文件什么位置读取。
读取位置会存在  /root/.sincedb_dbd93513aa1097729e1c1c9ac4b87310 这个文件中。要想每次从头读取,就要删除。

后台启动

nohup ./bin/logstash agent -f my.conf &

启动日志存在同级目录nohup.out这个文件里

ELK 2 – 熟悉配置

原文:http://www.cnblogs.com/datadev/p/5809226.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!