当日志文件包含单个多行日志时,td-agent无法从line发送日志。在添加新行之前,td-agent不会拾取日志
已在windows计算机上安装td-agent。配置td-agent.conf文件,从包含单个多行日志的文件中选取日志。在向文件中添加新行之前,不会发送日志
td-agent.conf
<source>
@type tail
path "C:/abc.txt"
pos_file etc/td-agent/pos/abc-file.pos
tag abc-file-test
multiline_flush_interval 5s
format multiline
<parse>
@type multiline
format_firstline /^2019*/
format1 /^(?<message>.*)/
</parse>
read_from_head true
</source>
<filter abc-file-**>
@type record_modifier
<record>
entity "abc"
component ${tag}
hostname "#{Socket.gethostname}"
</record>
</filter>
<match abc-file-**>
@type kafka_buffered
brokers "localhost:9092"
default_topic abc-topic
flush_interval 5s
kafka_agg_max_bytes 1000000
max_send_limit_bytes 10000000
discard_kafka_delivery_failed true
output_data_type json
compression_codec gzip
max_send_retries 1
required_acks 1
get_kafka_client_log true
</match>abc.txt日志文件:
2019-04-12 12:09:45 com发生INFO abc.java异常*
日志应该流向kafka,但它没有
发布于 2019-04-19 13:26:06
这是in_tail插件的局限性。使用带有multiline_end_regexp参数的fluent-plugin-concat怎么样?
https://stackoverflow.com/questions/55745476
复制相似问题