azure 使用Filebeat解析容器日志时出错

yacmzcpb  于 2022-11-17  发布在  其他
关注(0)|答案(1)|浏览(269)

我已经在Azure Kubernetes上创建了一个filebeat的demonset来收集日志并在Graylog上摄取,但似乎有一个与解析相关的解析错误,我无法弄清楚。请帮助我。
我从https://github.com/elastic/beats/tree/master/deploy/kubernetes/filebeat得到了代码
以下是错误:

2021-06-07T06:47:18.903431005Z2021-06-07T06:47:18.903Z ERROR [reader_docker_json] readjson/docker_json.go:204 Parse line error: parsing CRI timestamp: parsing time "2021/06/07" as "2006-01-02T15:04:05.999999999Z07:00": cannot parse "/06/07" as "-"

2021-06-07T06:47:18.903462505Z2021-06-07T06:47:18.903Z ERROR [reader_docker_json] readjson/docker_json.go:204 Parse line error: parsing CRI timestamp: parsing time "2021/06/07" as "2006-01-02T15:04:05.999999999Z07:00": cannot parse "/06/07" as "-"

2021-06-07T06:47:18.903469505Z2021-06-07T06:47:18.903Z ERROR [reader_docker_json] readjson/docker_json.go:204 Parse line error: parsing CRI timestamp: parsing time "2021/06/07" as "2006-01-02T15:04:05.999999999Z07:00": cannot parse "/06/07" as "-"
f0brbegy

f0brbegy1#

我在尝试让Filebeat读取/解析我的日志文件时遇到了一个类似的错误。我的解决方案是Filebeat配置(filebeat.yml)需要将输入类型设置为“log”(而不是我的例子中的“container”),如下例所示:

filebeat.inputs:
  - type: log
    scan_frequency: 1s
    paths:
        - '/pathto/log/*.log'

相关问题