1. 程式人生 > >CentOS6.9安裝Logstash

CentOS6.9安裝Logstash

centos6 blog local 0.10 目錄 body logstash last ash

一、下載地址

官網:https://www.elastic.co/cn/downloads/logstash

百度雲盤:

二、安裝

tar zxvf logstash-6.2.1.tar.gz
mv logstash-6.2.1 logstash

配置文件(配置文件放哪個目錄都可以,在啟動Logstash時可以指定配置文件位置)

vi k_es.conf
input{
    kafka {
        bootstrap_servers => "10.10.6.225:9092"    #kafka服務器地址,不是zookeeper
    client_id 
=> "test" auto_offset_reset => "latest" consumer_threads => 5 decorate_events => true topics => ["test"] #控制kafka哪個topic,可以多個用逗號分割 codec => "json" } } filter{ json { source => "message" remove_field
=>["message","beat","@version"] #刪除沒用的屬性 add_field =>["customize","自定義字段"] #增加屬性 } } output { elasticsearch { hosts => "localhost:9200" index => "logstash-nginxacclog-%{+YYYY.MM.dd}" #放到elasticsearch哪個index中 } }

啟動(到bin目錄下)

./logstash -f k_es.conf

CentOS6.9安裝Logstash