您好,我正在使用fluentbit将日志导出到fluentd。尽管正则表达式表达式与日志行匹配,日志的解析仍然无法进行
要复制
您的环境
<match fluent.**>
type null
</match>
<source>
@type tail
path /logs/access.log
pos_file /var/log/td-agent/personlog.pos
tag person.log
read_from_head true
format /^\s*(?<date>[^ ]*)\s+(?<time>[^ ]*)\s+\s+(?<log_level>[^ ]*)\s+(?<code>[^ ]*)\s+---\s+\[(?<host_thread>[a-zA-Z1-9\-\s]*)\]\s+(?<message>.*)/
</source>
<match *.**>
@type forward
@id forward_output
heartbeat_type none
<buffer time,tag,message>
@type memory
timekey 2s
timekey_wait 1s
flush_mode interval
flush_interval 1s
# use smaller retry setting for test
retry_max_interval 2s
retry_timeout 10s
</buffer>
{"Error log from fluentbit":"
<parse>
@type "regexp"
expression /^\s*(?<date>[^ ]*)\s+(?[^ ]*)\s+\s+(?[^ ]*)\s+(?[^ ]*)\s+---\s+\[(?[a-zA-Z1-9\-\s]*)\]\s+(?.*)/
unmatched_lines
</parse>"}
有什么需要帮助的吗?谢谢!