filebeat过滤

£可爱£侵袭症+ 提交于 2019-11-28 04:24:57

合并多行以[为头

multiline:
pattern: '^\['
negate: true
match: after

------------------------------------------------

过滤掉某行

exclude_lines: ['^#']----------------------------
# cat filebeat.yml
filebeat.prospectors:
- type: log
  paths:
    - /data/log/tomcat/localhost_access_log.*.txt
  exclude_lines: ['^#']
  fields:
    tag: accesslog-121
- type: log
  paths:
    - /data/log/tomcat/catalina.out
  exclude_lines: ['^#']
  fields:
    tag: catalina-121

filebeat.config.modules:
  path: ${path.config}/modules.d/*.yml

  reload.enabled: true
  
output.redis:
  hosts: ["127.0.0.1"]
  port: 6380
  key: "tomcat121-autoschedulecore-access-list"--------------------------------包含某行
filebeat.prospectors:
- input_type: log
  paths:
    - /tmp/test.log
  include_lines: [‘error‘]

 

 

---------------------------------------------------------------------------------------------------

filebeat.prospectors:
- type: log
paths:
- /ali/logs/*.out
multiline:
pattern: '^\['
negate: true
match: after
fields:
tag: log1
- type: log
paths:
- /ali/logs/*.conf
fields:
tag: log2
filebeat.config.modules:
path: ${path.config}/modules.d/*.yml
reload.enabled: false

output.redis:
hosts: ["127.0.0.1"]
port: 6380
key: "test-list"

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!