我正在尝试读取多行 jetty 日志,对于源代码,现在有人知道该怎么做吗?
<source>
type tail
format multiline
format_firstline /^\[/
format1 /^\[[^ ]* (?<time>[^\]]*)\] *(?<level>[^ ]*) $/
path /mnt/current/log/jettylog4j.log
pos_file /mnt/current/log/fluentd.jettylog4j.pos
read_from_head true
tag jettylog
refresh_interval 30
</source>
有了这个,我无法获得所有行的消息。
最佳答案
在我的例子中,我无法更改格式,因为它是遗留代码的一部分。我找到了适合我的模式。我把它放在这里以防对某人有用
<source>
type tail
format multiline
format_firstline /^\[/
format1 /^\[[^ ]* (?<time>[^\]]*)\] *(?<level>[^ ]*) (?<message>[^\n]*(\n^[^\[].*|$))/
path /mnt/current/log/jettylog4j.log
pos_file /mnt/current/log/fluentd.jettylog4j.pos
read_from_head true
tag jettylog
refresh_interval 30
</source>
关于log4j - Fluentd 读取多行 jetty 日志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27248285/