码迷,mamicode.com
首页 > 其他好文 > 详细

elk-redis

时间:2016-10-10 13:44:04      阅读:139      评论:0      收藏:0      [点我收藏+]

标签:

yum install redis -y

vim /etc/redis

[root@linux-node1 etc]# grep ‘^[a-z]‘ /etc/redis.conf

daemonize yes

pidfile /var/run/redis/redis.pid

port 6379

bind 192.168.14.136

? ?

/etc/init.d/redis start

? ?

redis-cli -h 192.168.14.136

info

? ?

? ?

? ?

redis里写数据,通过logstash

[root@linux-node1 application]# cat redis-indata.conf

? ?

input {

stdin{}

}

? ?

output{

redis{

host => "192.168.14.136"

port => "6379"

db => "6"

data_type => "list"

key => "system-syslog"

}

}

[root@linux-node1 application]# ./logstash/bin/logstash -f redis-indata.conf

? ?

随便输入

redis:

info

....

# Keyspace

db6:keys=1,expires=0,avg_ttl=0 <--创建了db6

192.168.14.136:6379> SELECT 6

OK

192.168.14.136:6379[6]> KEYS *

1) "demo"

? ?

192.168.14.136:6379[6]> LINDEX demo -1 <--列表最后一行

"{\"message\":\"adf\",\"@version\":\"1\",\"@timestamp\":\"2016-10-09T16:50:12.740Z\",\"host\":\"linux-node1.example.com\"}"

? ?

192.168.14.136:6379[6]> LLEN demo

(integer) 18

? ?

? ?

? ?

? ?

? ?

redis读出去:

input{

redis{

host => "192.168.14.136"

port => "6379"

db => "6"

data_type => "list"

key => "demo"

}

}

? ?

output{

elasticsearch{

hosts => ["192.168.14.136:9200"]

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

}

}

? ?

? ?

? ?

elk-redis

标签:

原文地址:http://www.cnblogs.com/iiiiher/p/5945320.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!