elk日志收集到redis中
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了elk日志收集到redis中相关的知识,希望对你有一定的参考价值。
apache_log------>logstash----->redis---->logstash----->es日志写到redis中
redis安装配置略
input{
path => "/var/log/access_log"
type => "acccess_log"
start_postition => "beginning"
}
output{
redis{
host => "ip"
port => 6379
db => "2"
data_type => "list"
key => "access_log"
}
}
logstash从redis中读取日志
input{
redis{
host => "ip"
port => 6379
db => "2"
data_type => "list"
key => "access_log"
type => "access_log"
}
}
filter{
grok{
match => { "messages" => "%{COMBINEDAPACHELOG}"} #logstash 默认组件
}
}
output{
elasticsearch {
hosts => ["ip:9200"]
index => "access_log-%{+YYYY.MM.dd}"
}
}
ab -n 100 -c 10 http://ip:port/index.jsp 100个请求,10个并发
以上是关于elk日志收集到redis中的主要内容,如果未能解决你的问题,请参考以下文章