首页 > 解决方案 > Filebeat 的 GCP 模块不断收到哈希配置错误

问题描述

我目前正在尝试将 GCP 的 Cloud Logging 转发到 Filebeat,以便在此文档之后转发到 Elasticsearch 并根据此文档在 filebeat 上设置 GCP 模块

目前我只尝试转发审计日志,所以我的gcp.yml模块如下

- module: gcp
  vpcflow:
    enabled: false
    var.project_id: my-gcp-project-id
    var.topic: gcp-vpc-flowlogs
    var.subscription_name: filebeat-gcp-vpc-flowlogs-sub
    var.credentials_file: ${path.config}/gcp-service-account-xyz.json
    #var.internal_networks: [ "private" ]

  firewall:
    enabled: false
    var.project_id: my-gcp-project-id
    var.topic: gcp-vpc-firewall
    var.subscription_name: filebeat-gcp-firewall-sub
    var.credentials_file: ${path.config}/gcp-service-account-xyz.json
    #var.internal_networks: [ "private" ]

  audit:
    enabled: true
    var.project_id: <my prod name>
    var.topic: sample_topic
    var.subscription_name: filebeat-gcp-audit
    var.credentials_file: ${path.config}/<something>.<something>

当我运行时,sudo filebeat setup我不断收到此错误

2021-05-21T09:02:25.232Z    ERROR   cfgfile/reload.go:258   Error loading configuration files: 1 error: Unable to hash given config: missing field accessing '0.firewall' (source:'/etc/filebeat/modules.d/gcp.yml')

虽然我可以启动该服务,但我似乎没有看到任何从 GCP 的 Cloud Logging 发布/订阅主题转发到弹性搜索的日志。

也将不胜感激有关最佳实践的帮助或提示。

更新

如果我按照这里的文档,它会给我同样的错误,但在audit

标签: elasticsearchgoogle-cloud-platformgoogle-cloud-pubsubfilebeat

解决方案


推荐阅读