More than one namespace configured accessing 'output'

I am using two filebeat configuration files. One config file is sending to Elasticsearch (filebeat.yml) and the other is sending to Logstash (filebeat2.yml). I chain these two config files with the following command:

command: ./filebeat -e -c filebeat.yml -c filebeat2.yml -d "publish"

But I get this error:

filebeat      | Exiting: error unpacking config data: more than one namespace configured accessing 'output' (source:'filebeat.yml')

filebeat.yml

filebeat.autodiscover:
  providers:
    - type: docker
      templates:
        - condition:
            contains:
              docker.container.image: redis
          config:
            - module: redis
              log:
                input:
                  type: docker
                  containers:
                    path: '/usr/share/filebeat/containers/'
                    stream: 'all'
                    ids:
                      - '${data.docker.container.id}'
output.elasticsearch:
  hosts: 'elasticsearch:9200'
setup.kibana:
  host: 'kibana:5601'

filebeat2.yml

filebeat.inputs:
- type: log
  paths: '/usr/share/filebeat/some-log-files/*'
output.logstash:
  hosts: 'logstash:5044'

Using the following filebeat docker image:

docker.elastic.co/beats/filebeat:6.4.0

Is there any way I can chain/trigger filebeat config files that have different outputs or combine them in one config file using one filebeat instance?

Filebeat supports only one output, but you configured 2.

You can run either 2 filebeat instances or route all events via logstash.

1 Like

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