Filebeat - 设置多行配置

时间:2017-05-12 07:36:46

标签: elasticsearch logstash elastic-stack filebeat

我有一个文件节点可以读取多种不同的日志格式。

一种工作正常的格式是单个衬垫,它作为单个事件发送到Logstash。 现在,我有另一种格式是多线程。我想将它作为单个事件读取并将其发送到Logstash进行解析。 这是日志格式示例,包含两个事件。

error: I READ THIS. sent payload: [{"key": "values"}]
custom status response: [{"key1": "values"}]
callback headers:  [{"key2": "values"}]
error stack: [ something really bad happened
    at here loremisptul (/xx/xx/x)
    at here loremisptul (/xx/xx/x)
    at here loremisptul (/xx/xx/x)
    at here loremisptul (/xx/xx/x)
    at here loremisptul (/xx/xx/x)
    at here loremisptul (/xx/xx/x)
    at here loremisptul (/xx/xx/x)
    at here loremisptul (/xx/xx/x)]

error: I AM NOT READING THIS. sent payload: [{"key": "values"}]
custom status response: [{"key1": "values"}]
callback headers:  [{"key2": "values"}]
error stack: [ something really bad happened
    at here loremisptul (/xx/xx/x)
    at here loremisptul (/xx/xx/x)
    at here loremisptul (/xx/xx/x)
    at here loremisptul (/xx/xx/x)
    at here loremisptul (/xx/xx/x)
    at here loremisptul (/xx/xx/x)
    at here loremisptul (/xx/xx/x)
    at here loremisptul (/xx/xx/x)]

以下是探矿者配置:

- input_type: log
  paths: /Users/xxxxx/Downloads/elk/anotherlog/app.stderr.log
  document_type: logsystemtwo
  multiline.pattern: '`^=[A-Z]+|^$`'
  multiline.negate: true
  multiline.match: after
- input_type: log
  paths: /Users/xxxxx/Downloads/elk/mylogs/access.log*
  document_type: logsystemone

问题在于第一条多线。它读取第一个事件(我读这个),但忽略其余部分(我没有读过这个)。

我尝试了很多不同的configurations,但我不能让它去阅读其他事件。 它总是只发送第一个事件,而忽略其余事件。

我知道我也可以在Logstash中执行多行,但根据应该避免的documentation。同样在我的情况下,我会避免在Logstash中这样做,因为我已经有非常复杂的结构

0 个答案:

没有答案