标签:elk elasticsea logstash kibana
Logstash+ElasticSearch+Kibana4
openjdk或者Oracle的jdk都可以。
这里用openjdk
yum install java-1.7.0-openjdk
yum install redis
/etc/init.d/redis start
查看redis中的键值
redis-cli keys ‘*‘
rpm -ivh elasticsearch-1.4.4.noarch.rpm
确认9200端口监听有正常返回值即可:
curl -X GET http://localhost:9200
[root@iZ28ywqw7nhZ ~]# curl -X GET http://localhost:9200
{
"status" : 200,
"name" : "Damballah",
"cluster_name" : "elasticsearch",
"version" : {
"number" : "1.4.4",
"build_hash" : "c88f77ffc81301dfa9dfd81ca2232f09588bd512",
"build_timestamp" : "2015-02-19T13:05:36Z",
"build_snapshot" : false,
"lucene_version" : "4.10.3"
},
"tagline" : "You Know, for Search"
}
rpm -ivh logstash-1.4.2-1_2c0f5a1.noarch.rpm
最简单的是接受一个输入,然后将在输出出来:
bin/logstash -e ‘input { stdin { } } output { stdout {} }‘
helo
2015-03-19T09:09:38.161+0000 iZ28ywqw7nhZ helo
类似的还有:
bin/logstash -e ‘input { stdin { } } output { stdout { codec => rubydebug } }‘
但是上面两个并没有很大的实际意义,我们可以将数据插入到elasticsearch中,然后用kibana显示出来。
/opt/logstash/bin/logstash -e ‘input { stdin { } } output { elasticsearch { host => localhost } }‘
然后可以用kibana 查看
或者访问
curl ‘http://localhost:9200/_search?pretty’ 来查看数据
kibana就是一个java包。
tar -xf kibana-4.0.1-linux-x64.tar.gz
bin/kibana > kibana.log &
里面配置index patterns ,用默认的就行了。
基本上elk都是连着用的,连官网都是同一个官方网站,比如说elasticsearch一般是从logstash上面取数据的。kibana 默认又是从elasticsearch上面取数据。三者结合的非常好。
更多功能正在探索中。elk 很强大的数据收集查询分析开源解决方案。
http://logstash.net/docs/1.4.2/tutorials/getting-started-with-logstash
http://www.cnblogs.com/buzzlight/p/logstash_elasticsearch_kibana_log.html
Upgrade Required Your version of Elasticsearch is too old. Kibana requires Elasticsearch 0.90.9 or above.
init: tty (/dev/tty4) main process killed by KILL signal
list all indexs
curl ‘localhost:9200/_cat/indices?v’
delete
curl -XDELETE ‘localhost:9200/customer?pretty’
curl ‘localhost:9200/_cat/indices?v’
http://www.elastic.co/guide/en/elasticsearch/reference/1.x/_index_and_query_a_document.html
elk 日志分析系统Logstash+ElasticSearch+Kibana4
标签:elk elasticsea logstash kibana
原文地址:http://blog.csdn.net/aca_jingru/article/details/44488703