流监控日志通过redis到elastic
supervisor-elastic的Python项目详细描述
状态
==
[![构建状态](https://travis ci.org/woutervb/supervisor_elastic.png)(https://travis ci.org/woutervb/supervisor_elastic)
主要原因是,redis在一个高可用性
设置中相对简单,因此它不会(或几乎不会)阻塞python中的主处理循环。
处理数据的时间完全取决于logstash代理的性能,它将从redis中读取日志记录
,并将它们放入elasticsearch中以备将来使用。处理。
此设置已被证明在几年内相当稳定。但缺少的一点是,能够将主管的
日志添加到此日志系统。显然,可以使用file be at读取日志文件,然后将它们发送到logstash,但是由于supervisor是用python编写的,所以通过redis使用相同的路由更有意义。
这是这个项目创建的wat。
那是在主管和后勤室。需要supervisor配置
将消息发送到redis,需要logstash配置从redis中提取数据。
supervisor配置
这些
变量列在下面。
*redis_log_uri包含redis的url,它遵循iana以redis://[:password]@host:post/database形式提供的文档
*redis_log_channel,用于日志记录的通道,这应该与logstash配置中的相同
supervisor.conf的一个示例部分是:
[eventlistener:logging]
command=supervisor_elastic
events=process_log
environment=redis_log_uri=“redis://dockerhost”,redis_u logu channel=“app:python”
另一个需要注意的重要问题是,在主管配置中的每个程序定义中,应该激活以下键:
stdout戋u events戋u enabled=true
stderr戋u events戋u enabled=true
发送到已定义的事件列表器。
logstash的配置
--------
,logstash中的等效部分将是:
\collect python logging from redis
input{
redis{
host=>;“dockerhost”
codec=>;json
data=>;“channel”
type=>;“python”
key=>;“app:python”
tags=>;[“json”]
}
}
}
至少是密钥(在logstash中)应该等于supervisor
配置中的redis_log_通道。
==
[![构建状态](https://travis ci.org/woutervb/supervisor_elastic.png)(https://travis ci.org/woutervb/supervisor_elastic)
主要原因是,redis在一个高可用性
设置中相对简单,因此它不会(或几乎不会)阻塞python中的主处理循环。
处理数据的时间完全取决于logstash代理的性能,它将从redis中读取日志记录
,并将它们放入elasticsearch中以备将来使用。处理。
此设置已被证明在几年内相当稳定。但缺少的一点是,能够将主管的
日志添加到此日志系统。显然,可以使用file be at读取日志文件,然后将它们发送到logstash,但是由于supervisor是用python编写的,所以通过redis使用相同的路由更有意义。
这是这个项目创建的wat。
那是在主管和后勤室。需要supervisor配置
将消息发送到redis,需要logstash配置从redis中提取数据。
supervisor配置
这些
变量列在下面。
*redis_log_uri包含redis的url,它遵循iana以redis://[:password]@host:post/database形式提供的文档
*redis_log_channel,用于日志记录的通道,这应该与logstash配置中的相同
supervisor.conf的一个示例部分是:
[eventlistener:logging]
command=supervisor_elastic
events=process_log
environment=redis_log_uri=“redis://dockerhost”,redis_u logu channel=“app:python”
另一个需要注意的重要问题是,在主管配置中的每个程序定义中,应该激活以下键:
stdout戋u events戋u enabled=true
stderr戋u events戋u enabled=true
发送到已定义的事件列表器。
logstash的配置
--------
,logstash中的等效部分将是:
\collect python logging from redis
input{
redis{
host=>;“dockerhost”
codec=>;json
data=>;“channel”
type=>;“python”
key=>;“app:python”
tags=>;[“json”]
}
}
}
至少是密钥(在logstash中)应该等于supervisor
配置中的redis_log_通道。