Fluentd Regular Expression Matching invalid time format error

Viewed 24

I am trying to parse the logs from kubernetes like this for example

<source>
  @type tail
  @id in_tail_container_logs
  path /var/log/containers/inswave-web*-*_inswave-web*_inswave-web*-*.log
  pos_file /var/log/fluentd-containers.log.pos
  tag "kubernetes.*"
  read_from_head true
  <parse>
    @type "regexp"
    expression /^(?<time>.+) (?<stream>stdout|stderr)( (?<logtag>.))? (?<log>.*)$/
    time_format "%Y-%m-%dT%H:%M:%S.%NZ+09:00 stdout F"
  </parse>
</source>

What could be wrong? I have had similar errors with the built-in parser for apache logs as well?

error="invalid time format: value = 2022-09-19T13:15:59.276962421+09:00, error_class = ArgumentError, error = string doesn't match"

0 Answers
Related