合并多行以[为头

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"

相关文章:

  • 2021-07-24
  • 2022-12-23
  • 2022-12-23
  • 2021-10-04
  • 2021-06-14
  • 2022-02-06
  • 2021-11-13
  • 2021-08-27
猜你喜欢
  • 2021-11-05
  • 2021-06-18
  • 2022-12-23
  • 2022-03-02
  • 2021-07-11
  • 2021-08-26
  • 2021-09-30
相关资源
相似解决方案