Filebeat autodiscovery: appenders

Hi,
I would like to set up Filebeat configuration with kubernetes autodiscovery provider to collect all namespaces pods logs. I use templates work well , but when i use appenders, filebeat run is wrong.

i also use filebeat docs, https://www.elastic.co/guide/en/beats/filebeat/6.x/configuration-autodiscover.html#_appenders , but also wrong.

wrong logs : Exiting: error loading config file: yaml: line 7: mapping values are not allowed in this context

Filebeat version is master branch

filebeat.yml:

filebeat.autodiscover:
  providers:
    - type: kubernetes
      builders:
        - type: hints
      appenders:
        - type: config
            - condition.not.equals:
                kubernetes.namespace: ""
              config:
                fields:
                  kubernetes_cluster: beatcloud

Could anyone help me out with the correct appenders format? Thanks

Have you checked indentation and use of tabs (don't use tabs). Your sample config is no valid YAML. The error message is about your document being invalid and can not even be read.

Linters like http://www.yamllint.com can be helpful to identify YAML errors.

Thanks for your reply.

The sample config is no valid YAML. However it's official docs sample config, so i want Whether the official sample config is wrong?

I don't know the correct appenders format, can you help me?

I think you are right there is a typo in the configuration concerning the appenders but this feature just got merged 18 days ago, are you using a snapshot build of 6.x?

Created https://github.com/elastic/beats/pull/6720 to fix the yaml in the example documentation

no ,i use the newest master branch to build filebeat

ok. Thanks

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.