尽管正则表达式匹配,但Fluentbit日志解析遇到错误

时间:2020-06-24 17:06:17

标签: fluentd fluent-bit rubular

错误报告

您好,我正在使用fluentbit将日志导出到fluentd。尽管正则表达式表达式与日志行匹配,日志的解析仍然无法进行

要复制

您的环境

  • 环境:Kubernetes
  • 操作系统和版本:CentOS Linux 7.8.2003版(核心)
  • 使用的版本:fluentd =“ 1.11.1” ruby​​ =“ 2.4.10”
  • 配置:
  • td-agent.conf
 <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>"}

fluentbit_error.png

有什么需要帮助的吗?谢谢!

0 个答案:

没有答案