输出到kafka集群中
代码语言:javascript
复制filebeat.inputs:
- type: log
enabled: true
paths:
- /home/admin/taobao-tomcat-production-7.0.59.3/logs/catalina.out
fields:
local_type: 'tomcat' #这些都是附加的标签
local_ip: 1.1.1.1
local_host: 'prod_商品_1'
fields_under_root: true #将标签放到顶头,不然在message字段里
multiline.pattern: '^20' #20开头和20开头之间的算作一行,具体根据日志情况
multiline.negate: true
multiline.match: after
filebeat.config.modules:
path: ${path.config}/modules.d/*.yml
reload.enabled: false
setup.template.settings:
index.number_of_shards: 3
output.kafka:
enabled: true
hosts: ["1.1.1.1:9092","1.1.1.2:9092","1.1.1.3:9092"] #kafka集群地址
topic: 'tomcat-server-log' #topic名