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

K8S 日志收集(四):logstash 安装

时间:2018-04-28 14:10:20      阅读:403      评论:0      收藏:0      [点我收藏+]

标签:启动   arc   json   boot   top   als   2.4   nts   usr   

下载logstash

wget https://artifacts.elastic.co/downloads/logstash/logstash-6.2.4.rpm
rpm -ivh http://192.168.19.111:8080/panjunbai/logstash-6.2.4.rpm

编写配置文件

[root@kibana logstash]# cat /etc/logstash/conf.d/f1.conf 
input {
  kafka{
        bootstrap_servers => ["192.168.7.204:9092"]
        client_id => "testpanjunbai"
        group_id => "testpanjunbai"
        auto_offset_reset => "latest" 
        consumer_threads => 1
        decorate_events => false
        topics => ["20180421"]
        codec => "json"}
}

output{  
  elasticsearch{  
    hosts=>["192.168.19.93:9200"]  
    index=> "%{[kubernetes][container_name]}-%{+YYYY-MM-dd}"      
    action => "index"

      
    } 
}

启动logstash

export  LS_SETTINGS_DIR=/etc/logstash/
/usr/share/logstash/bin/logstash -f /etc/logstash/conf.d/f1.conf &

K8S 日志收集(四):logstash 安装

标签:启动   arc   json   boot   top   als   2.4   nts   usr   

原文地址:https://www.cnblogs.com/panjunbai/p/8966494.html

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