日誌分析ELK:Elasticsearch , Logstash, Kibana 安裝(1)

  1. Logstash安裝
    1. 解壓

# tar zxvf logstash-2.4.0.tar.gz  -C /usr/localredis

 

 

 

 

    1. 轉移到解壓後的目錄

# cd /usr/local/logstash-2.4.0/json

 

    1. 建立配置目錄

# mkdir conf   logsvim

        

 

 

    1. 建立配置文件

# vim conf/central.conf elasticsearch

 

 

    1. 輸入配置信息

input {spa

        redis {#輸入配置,這是使用本機rediscode

                           host => "127.0.0.1"blog

                           port => 6379input

                                type => "redis-input"it

                                data_type => "list"ast

                                key => "key_count"

                     }

}

output {

        stdout {}

        elasticsearch {#輸出信息配置,這裏使用elasticsearch

                hosts => "localhost:9200"

                codec => "json"

                index => "logstash-%{+YYYY.MM.dd}"

        }

}

            

    1. 退出保存

 

# :wq!

 

 

    1. 啓動logstash

     # bin/logstash agent --verbose --config conf/central.conf –log logs/stdout.log

 

                 

 

       

相關文章
相關標籤/搜索