ELK之filebeat-redis-logstash-es构架模式
下载filebeat的rpm包安装filebeat
wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-6.3.0-x86_64.rpm
安装
filebeat-6.3.0-x86_64.rpm
配置文件/etc/filebeat/filebeat.yml


写一个配置文件
filebeat.inputs:
- type: log
enabled: true
paths:
- /var/log/*.log
- /var/log/messages exclude_lines: ['^DBG','^$']
document_type: system-log-5611
filebeat.config.modules:
path: ${path.config}/modules.d/*.yml
reload.enabled: false
setup.template.settings:
index.number_of_shards: 3
setup.kibana:
output.file:
path: "/tmp"
name: "filebeat.txt"

默认不带type这里自定义type为document_type: system-log-5611
排除空行exclude_lines: ['^DBG','^$']
这里不写入到elasticsearch而是先写入到一个文件
启动
systemctl start filebeat
PS:在/tmp下面生成了文件filebeat但是没有txt(原因未知)
修改配置文件把输出改成redis
filebeat.inputs:
- type: log
enabled: true
paths:
- /var/log/*.log
- /var/log/messages
tags: ["system-log-5611"]
exclude_lines: ['^DBG','^$']
filebeat.config.modules:
path: ${path.config}/modules.d/*.yml
reload.enabled: true
setup.template.settings:
index.number_of_shards: 3
setup.kibana:
output.redis:
hosts: ["192.168.56.11"]
db: "3"
port: "6379"
password: "123456"
key: "system-log-5611"
PS:tags才能生效 redis里面的key不能输出对应的key值(filebeat版本为6.3)
redis必须设置密码,否则启动filebeat报错,报错日志文件为/var/log/filebeat/filebeat
重启filebeat
systemctl restart filebeat
使用echo的方式往/var/log/messages插入几条数据然后使用客户端连接redis查看

配置使用logstash取出redis里面的数据
input{
redis {
host => "192.168.56.11"
port => "6379"
password => "123456"
db => "3"
data_type => "list"
key => "system-log-5611"
}
}
output{
if "system-log-5611" in [tags] {
elasticsearch {
hosts => ["192.168.56.11:9200"]
index => "system-log-5611-%{+YYYY.MM.dd}"
}
stdout{
codec => rubydebug
}
}
}
启动logstash输出

同时elasticsearch也收到了

ELK之filebeat-redis-logstash-es构架模式的更多相关文章
- 0415关于通过FILEBEAT,LOGSTASH,ES,KIBNA实现数据的采集
如何通过FILEBEAT,LOGSTASH,ES,KIBNA实现数据的采集总体参考网址:https://www.olinux.org.cn/elk/1157.html官方网址:https://www. ...
- ELK之filebeat替代logstash收集日志
filebeat->redis->logstash->elasticsearch 官网下载地址:https://www.elastic.co/downloads/beats/file ...
- filebeat+redis+logstash+elasticsearch+kibana搭建日志分析系统
filebeat+redis+elk搭建日志分析系统 官网下载地址:https://www.elastic.co/downloads 1.下载安装filebeat wget https://artif ...
- filebeat+redis+logstash+elasticsearch基本配置--适用于6.4版本
filebeat配置: filebeat.inputs:- type: log enabled: true paths: - /opt/xxxx.log fields: ...
- ELK 使用filebeat替代Logstash收集日志
使用beats采集日志 之前也介绍过beats是ELK体系中新增的一个工具,它属于一个轻量的日志采集器,以上我们使用的日志采集工具是logstash,但是logstash占用的资源比较大,没有beat ...
- ELK之filebeat、logstash多个topic配置
启动多个进程收集日志.直接output到kafka,output到不同的topiccat filebeat.ymlfilebeat.prospectors:- input_type: log path ...
- elk系列8之logstash+redis+es的架构来收集apache的日志【转】
preface logstash--> redis --> logstash --> es这套架构在讲究松耦合关系里面是最简单的,架构图如下: 解释下这个架构图的流程 首先前端log ...
- elk系列8之logstash+redis+es的架构来收集apache的日志
preface logstash--> redis --> logstash --> es这套架构在讲究松耦合关系里面是最简单的, 架构图如下: 解释下这个架构图的流程 首先前端lo ...
- Docker搭建ElasticSearch+Redis+Logstash+Filebeat日志分析系统
一.系统的基本架构 在以前的博客中有介绍过在物理机上搭建ELK日志分析系统,有兴趣的朋友可以看一看-------------->>链接戳我<<.这篇博客将介绍如何使用Docke ...
- ELK快速入门(四)filebeat替代logstash收集日志
ELK快速入门四-filebeat替代logstash收集日志 filebeat简介 Filebeat是轻量级单用途的日志收集工具,用于在没有安装java的服务器上专门收集日志,可以将日志转发到log ...
随机推荐
- python打造线程池
# coding=utf-8 import threading import Queue import time import traceback class ThreadPoolExecutor(o ...
- 实战c++中的string系列--不要使用memset初始化string(一定别这么干)
參考链接: http://www.cppblog.com/qinqing1984/archive/2009/08/07/92479.html 百度百科第一次这么给力: void *memset(voi ...
- GoF--适配器设计模式
1.概念: 适配器模式(Adapter Pattern)把一个类的接口变换成客户端所期待的另一种接口,从而使原本因接口不匹配而无法在一起工作的两个类能够在一起工作. 2.形式 a.类的适配器模式 ...
- cocos2d-x 3.0 在C++中调用lua函数
代码用的是<cocos2d-x 3.0 在lua中调用自定义类>中的代码. 在上篇的基础上进行扩充. 写lua函数 local function process_packet(user_d ...
- HTML 换行
<br /> 标签可以用于换行 <!DOCTYPE HTML> <html> <body> <p> I like Playing. < ...
- 流媒体服务器+EasyDarwin+EasyPusher+VLC+Red5+OBS+Unity+RTSP+RTMP+FFMPEG
最近有个需求在Unity中直播桌面,着用到了视频流. ------------------------------ VLC自身有流服务器功能,但是非常慢非常慢,还是用VLC拉流吧,好像大家也是这么做的 ...
- hadoop JOB的性能优化实践
使用了几个月的hadoopMR,对遇到过的性能问题做点笔记,这里只涉及job的性能优化,没有接触到 hadoop集群,操作系统,任务调度策略这些方面的问题. hadoop MR在做大数据量分析时候有限 ...
- Python时间戳与时间字符串互相转换实例代码
#设a为字符串import timea = "2011-09-28 10:00:00" #中间过程,一般都需要将字符串转化为时间数组time.strptime(a,'%Y-%m-% ...
- webform的学习(2)
突然回想一下,两周之后放假回家,三周之后重返学习,四周之后就要真正的面对社会,就这样有好多的舍不得在脑海中回旋,但是又是兴奋的想快点拥有自己的小生活,似乎太多的人在说程序的道路甚是艰难,我不知道我的选 ...
- Android设置横屏竖屏
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FUL ...