Fileabeat - 具有多行日志的多个文件

时间:2017-05-24 20:59:01

标签: elasticsearch filebeat

我在unix服务器上安装了filebeat rpm,我正在尝试使用多行日志读取3个文件,我对使用filebeat进行多行匹配有所了解,但我想知道是否可以匹配3个单独的日志。

由于

1 个答案:

答案 0 :(得分:2)

您可能基本上需要multiple prospectors

示例,(未测试)

filebeat.prospectors:
- input_type: log
  paths:
    - /var/log/app1/file1.log
  multiline.pattern: '^\[[0-9]{4}-[0-9]{2}-[0-9]{2}'
  multiline.negate: false
  multiline.match: after

- input_type: log
  paths:
    - "/var/log/app2/file2.log"

- input_type: log
  paths:
    - "/var/log/app3/file3.log"
  • negate: truematch: after =>指定与指定模式不匹配的任何行属于上一行

参考

https://www.elastic.co/guide/en/beats/filebeat/current/multiple-prospectors.html

https://www.elastic.co/guide/en/beats/filebeat/current/multiline-examples.html

Understanding Multiline

相关问题