ELK集群-Logstash安装配置(四)

安装

tar -zxvf logstash-6.2.2.tar.gz
mv logstash-6.2.2    /home/elk/logstash-6.2.2-01
cp -r  /home/elk/logstash-6.2.2-01   /home/elk/logstash-6.2.2-02

配置

logstash-pipeline01.conf

input{
	kafka{
   			bootstrap_servers => ["172.30.1.199:9092"]
    		client_id => "nic01"
    		group_id => "nic"
    		#从最新的偏移量开始消费
			auto_offset_reset => "latest" 
    		consumer_threads => 7
			#此属性会将当前topic、offset、group、partition等信息也带到message中
    		decorate_events => true
			codec => "json" 
			#数组类型,可配置多个topic
    		topics => ["test-business","test-peccancy","test-carwash","test-oilcard","test-personalcenter","test-system","test-task","test-consumer"]
			#所有插件通用属性,尤其在input里面配置多个数据源时很有用
			type => "chengniu" 
}
}
output {
			elasticsearch {
			#ES集群
			hosts => ["172.30.1.1:9250", 	"172.30.1.1:9251","172.30.1.1:9252","172.30.1.1:9253","172.30.1.1:9254"]
			index => "nic-%{[fields][service]}-%{+YYYY.MM.dd}"
}
}

logstash-pipeline02.conf

配置同上

启动

进入bin目录下执行:

./logstash -f ../config/logstash-pipeline01.conf
或
nohup  ./logstash -f ../config/logstash-pipeline01.conf  &
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值