一个filebeat实例 设置多topic设置
方法1:一实例多topic:
https://discuss.elastic.co/t/filebeat-5-0-output-to-kafka-multiple-topics/67934

The document_type per prospector becomes the event field type. That's why the filter won't match. Instead of conditionals consider using the format string like: filebeat.prospectors:
- ...
document_type: myapp_applog
- ...
document_type: myapp_applog_stats
- ...
document_type: myapp_elblog output.kafka:
topic: '%{[type]}' # use document_type to set topic btw. the topic field in conditionals also supports format strings.
cat filebeat.yml output.kafka:
enabled: true
hosts: ["192.168.111.107:9092","192.168.111.108:9092","192.168.111.109:9092"]
topic: '%{[type]}' filebeat.prospectors:
#------------------------------ Log prospector --------------------------------
- paths:
- /data/logs/financial-manager/server0.log
fields:
app_id: financial-manager
multiline.pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}\s(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d\.'
multiline.negate: true
multiline.match: after
document_type: log-log4j - paths:
- /data/logs/user-service/*.log
fields:
app_id: user-service
multiline.pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}\s(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d\.'
multiline.negate: true
multiline.match: after
document_type: log-iis - paths:
- /data/logs/financial-manager/access_log.log
fields:
app_id: financial-manager
document_type: log-undertow
方法二:多filebeat实例,每个filebeat实例设置一个topic
运行多个filebeat实例,每个实例对应一个配置文件
cat filebeat.yml output.kafka:
enabled: true
hosts: ["192.168.111.107:9092","192.168.111.108:9092","192.168.111.109:9092"]
topic: log-log4j filebeat.prospectors:
#------------------------------ Log prospector --------------------------------
- paths:
- /data/logs/subscribe-consumer/server0.log
fields:
app_id: subscribe-consumer multiline.pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}\s(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d\.'
multiline.negate: true
multiline.match: after
cat filebeat2.yml output.kafka:
enabled: true
hosts: ["192.168.111.107:9092","192.168.111.108:9092","192.168.111.109:9092"]
topic: log-tomcat filebeat.prospectors:
#------------------------------ Log prospector --------------------------------
- paths:
- /data/logs/subscribe-consumer/server0.log
fields:
app_id: subscribe-consumer multiline.pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}\s(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d\.'
multiline.negate: true
multiline.match: after
一个filebeat实例 设置多topic设置的更多相关文章
- 每天一个JavaScript实例-展示设置和获取CSS样式设置
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content ...
- 实例讲解Oracle数据库设置默认表空间问题
实例讲解Oracle数据库设置默认表空间问题 实例讲解Oracle数据库设置默认表空间问题,阅读实例讲解Oracle数据库设置默认表空间问题,DBA们经常会遇到一个这样令人头疼的问题:不知道谁在O ...
- Filebeat 根据不同的日志设置不同的索引
平时在物理机上使用 Filebeat 收集日志时,会编写多个 filebeat 配置文件然后启动多个 filebeat 进程来收集不同路径下的日志并设置相对应的索引.那么如果将所有的日志路径都写到一个 ...
- 试图删除 xx 和yy之间的关系。但是,关系的其中一个外键 (xx_yy.xxID) 无法设置为 null。
错误原因:试图删除 UserInfoGroup 和 UserInfoGroupLinkLimitsOfAuthority 之间的关系.但是,关系的其中一个外键 (UserInfoGroupLinkLi ...
- ES 记录之如何创建一个索引映射,以及一些设置
ElasticSearch 系列文章 1 ES 入门之一 安装ElasticSearcha 2 ES 记录之如何创建一个索引映射 3 ElasticSearch 学习记录之Text keyword 两 ...
- NPOI2.2.0.0实例详解(十)—设置EXCEL单元格【文本格式】 NPOI 单元格 格式设为文本 HSSFDataFormat
NPOI2.2.0.0实例详解(十)—设置EXCEL单元格[文本格式] 2015年12月10日 09:55:17 阅读数:3150 using System; using System.Collect ...
- delphi开发实例:保存字体设置的方法
http://blog.csdn.net/delphi308/article/details/9906147 delphi开发实例:保存字体设置的方法 2013-08-11 22:37 446人阅读 ...
- 【记录一个问题】android ndk下设置线程的亲缘性,总有两个核无法设置成功
参考了这篇文章:https://blog.csdn.net/lanyzh0909/article/details/50404664 大体的代码如下: #include <pthread.h> ...
- Android 只开启一个Activity实例
在一个Activity中,多次调用startActivity()来启动另一个Activity,要想只生成一个Activity实例,方法有两种. 方法一:设置起动模式 一个Activity有四种启动模式 ...
随机推荐
- JS地址自动返填技术
系统设计地址为省市县三级联动,规范是规范了,但是无形中增加了系统操作的时间成本,因此设计地址自动返填技术,只要把地址拷贝到详细地址框中,可以自动返填到省市县三级联动的下拉框中. 还好洒家的大学不是混过 ...
- [3140] Sublime Text 2.x, 3.x 通用注册码、密钥集合
[3140] Sublime Text 2.x, 3.x Universal License Keys collection for Win, Mac & Lin 所有这些许可证密钥都被测试( ...
- 初识PHP(四)PDO对象配置于使用
一.PDO的概念 PDO其实就是一个数据库的抽象层,使用PDO编程可以方便的在之后的实际运营中随时更改数据库而不用变更源代码.PDO的位置如下图所示: 二.PDO的开启 PDO需要使用php 5.1 ...
- 中通快递单api查询
request POST https://hdgateway.zto.com/WayBill_GetDetail HTTP/1.1Host: hdgateway.zto.comConnection: ...
- fiddler几种功能强大的用法(一)
参考网址: http://caibaojian.com/fiddler.html http://www.cnblogs.com/tangdongchu/p/4178552.html 1.fiddler ...
- fiddler几种功能强大的用法(二)
参考网址:http://blog.rekfan.com/articles/228.html http://www.cnblogs.com/tugenhua0707/p/4637771.html htt ...
- jvm 内存调整
top查看java占用的内存比较多 top - :: up days, :, user, load average: 0.03, 0.05, 0.05 Tasks: total, running, s ...
- 在触发器中,当“IsMouseOver”属性=true时,设置当前控件的高亮选中效果
<Style.Triggers> <!--<Trigger Property="IsSelected" Value="Tru ...
- Android之水波纹点击效果(RippleView)
Android5.0后各种炫的效果纷纷出来,写这篇博客主要是讲的是按钮点击效果带有的水波纹(波浪式). 当然我写的这个是自定义来实现的,在低版本(5.0一下)也可以实现点击效果.看看效果图: 上图可看 ...
- hdu3032sg打表找规律
先打个表冷静一下 #include<map> #include<set> #include<cmath> #include<queue> #includ ...