下载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 &
所有评论(0)