Elasticsearch
[logstash] kafka 연동 설정
'김용환'
2017. 3. 13. 15:15
특정 로그 파일(birthday.log)을 logstash를 통해 kafka로 보내려고 한다.
이미 logstash, kafka가 설치되어 있다고 가정한다.
# logstash 설정
input {
file {
type => "birthday_log"
path => [
"/home/www/googleplus/birthday.log"
]
}
}
output {
kafka {
codec => plain { format => "%{host} %{message}" }
topic_id => "%{type}"
request_required_acks => 1
broker_list => "server-ip:9092"
}
}
# kafka에서 보기
$ /usr/local/kafka/bin/kafka-console-consumer.sh --topic birthday_log --zookeeper zk-server-ip:2181