标签:
logstash(1.4.2)是一个不错的日志监控与分析工具,数据通过logstash使用后端的ElasticSearch(1.1.1)集群完成数据索引,以供后续的查询、分析使用。版本必须保持兼容否则报一下错误
Upgrade Required Your version of Elasticsearch is too old. Kibana requires Elasticsearch 0.90.9 or above. Error Could not reach http://182.92.7.29:9200/_nodes. If you are using a proxy, ensure it is configured correctly
版本不兼容问题造成的问题。
通过wget命令下载Logstash与Elasticsearch,具体如下:
官方地址:http://www.logstash.net/docs/1.4.2/
wget https://download.elasticsearch.org/logstash/logstash/logstash-1.4.2.tar.gz
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.1.1.tar.gz
1、启动elasticsearch,代码如下:
/usr/local/search/elasticsearch-1.1.1/bin/elasticsearch
在/usr/local/search/logstash-1.4.2/目录下新建目录,代码如下:
mkdir conf vi redis.conf
具体内容,代码如下:
input { redis { host => "123.57.47.154" port =>"6379" data_type =>"list" key => "logstash:redis" type => "redis-input" } file { path => "/usr/local/search/logs/log-2015-06-03.log" } } output { elasticsearch { host =>"127.0.0.1"#内部IP地址(必须) port => "9300" cluster => "elasticsearch" } }
2、启动Logstash,代码如下:
/usr/local/search/logstash-1.4.2/bin/logstash -f /usr/local/search/logstash-1.4.2/conf/redis.conf
之后显示如下,说明启动成功。
Using milestone 2 input plugin ‘file‘. This plugin should be stable, but if you see strange behavior, please let us know! For more information on plugin milestones, see http://logstash.net/docs/1.4.2/plugin-milestones {:level=>:warn}
3、启动Logstash-web,代码如下:
/usr/local/search/logstash-1.4.2/bin/logstash-web
4、访问地址:
http://123.57.47.154:9292/index.html#/dashboard/file/logstash.json
存在数据说明成功了。
Logstash与Elasticsearch日志分析系统搭建
标签:
原文地址:http://my.oschina.net/freelife/blog/464565