This article describes if you use theLogstash,Elasticsearch,KibanaBuild a log analysis system.LogstashThe supported log types are very broad and supportnginx,postfix.windowsSystem logs,JavaLogs, andMySQLSlow query log,Dockerand a powerful filter function that can also be output toElasticsearch,Nagios,mailAnd so on, the function is quite strong, in the log analysis system that we want to deployLogstashUsed to collect various logs and then push them toElasticsearch,KibanaResponsible for the adoptionWebThe interface is finally displayed.
Environment Introduction:
Operating system version:centos6.6 64bit
Logstash version : logstash-2.0.0.tar.gz
Elasticsearch version:elasticsearch-2.1.0.tar.gz
Kibana version:Kibana 4.2.1
Java version:1.8.0_45
One: Software download
# wget https://download.elastic.co/logstash/logstash/logstash-2.0.0.tar.gz
# wget Https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch /2.1.0/elasticsearch-2.1.0.tar.gz
# wget https://download.elastic.co/kibana/kibana/kibana-4.2.1-linux-x64.tar.gz
II: Software Installation
1: Installing the Java Environment
# java-version
Java Version "1.8.0_45"
Java (TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot (TM) 64-bit Server VM (build 25.45-b02, Mixed mode)
2: Unpacking the Package
# TAR-ZXVPF Logstash-2.0.0.tar.gz
# MV Logstash-2.0.0/usr/local/logstash
# TAR-ZXVPF Elasticsearch-2.1.0.tar.gz
# MV Elasticsearch/usr/local/elasticsearch
# TAR-ZXVPF Kibana-4.2.1-linux-x64.tar.gz
# MV Kibana-4.2.1/usr/local/kibana
3: Start elasticsearch,Kibana
Here you can modify the yml configuration file According to your actual needs.
# Useradd Yang
# Chown-r yang.yang/usr/local/elasticsearch/
# nohup Su-yang-c/usr/local/elasticsearch/bin/elasticsearch &
#/usr/local/kibana/bin/kibana
4: Configure Logstash, Run test
# logstash-e ' Input{stdin{}}output{stdout{codec=>rubydebug}} '
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/76/EA/wKioL1ZewQujURhJAABW-A5JlTY920.png "title=" Picture 1.png "alt=" Wkiol1zewqujurhjaabw-a5jlty920.png "/>
Configuration file Run logstash test , push data to Elasticsearch
# cat/usr/local/logstash/etc/logstash.conf
Input {
stdin {}
}
Output {
stdout {
codec = rubydebug {}
}
Elasticsearch {
hosts = "192.168.115.5"}
}
#/usr/local/logstash/bin/logstash-f/usr/local/logstash/etc/logstach.conf
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/76/EB/wKiom1ZewNTBGy1LAACzo8qWIr0866.png "title=" Picture 2.png "alt=" Wkiom1zewntbgy1laaczo8qwir0866.png "/>
Http://192.168.115.5:9200/_search?q=hello
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/76/EB/wKiom1ZewO_h0ZgeAABrfyRsKko499.png "title=" Picture 3.png "alt=" Wkiom1zewo_h0zgeaabrfyrskko499.png "/>
Configure the appropriate index prefixes on the Kibana
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/76/EA/wKioL1ZewXmC43YaAAFisphsO_w189.png "title=" Picture 4.png "alt=" Wkiol1zewxmc43yaaafisphso_w189.png "/>650) this.width=650; src=" http://s2.51cto.com/wyfs02/M02/ 76/eb/wkiom1zewssrfv-4aaeukydcaik776.png "title=" image 5.png "alt=" Wkiom1zewssrfv-4aaeukydcaik776.png "/>
This article from "Chop Month" blog, declined reprint!
Logstash Log System Setup