# Migrate Filebeat autodiscover for Docker containers to Fleet managed Elastic Agent setup

**URL:** https://discuss.elastic.co/t/migrate-filebeat-autodiscover-for-docker-containers-to-fleet-managed-elastic-agent-setup/366162
**Category:** Elastic Agent
**Tags:** fleet
**Created:** [September 6, 2024, 2:52pm UTC](https://discuss.elastic.co/t/migrate-filebeat-autodiscover-for-docker-containers-to-fleet-managed-elastic-agent-setup/366162 "2024-09-06T14:52:08Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![piers.geyman](https://avatars.discourse-cdn.com/v4/letter/p/e0b2c6/32.png) [@piers.geyman](https://discuss.elastic.co/u/piers.geyman)
#### Post date: [September 6, 2024, 2:52pm UTC](https://discuss.elastic.co/t/migrate-filebeat-autodiscover-for-docker-containers-to-fleet-managed-elastic-agent-setup/366162/1 "2024-09-06T14:52:08Z")

</div>

We are currently using Filebeat with autodiscover to send logs from Docker containers of different flavours (Apache HTTP, MySQL, etc).

We are now trying to migrate over to Elastic Agent with Fleet managed agents, but I cannot find any documentation or examples of how to configure the agents with an equivalent setup to what we have with Filebeat and autodiscover.

How can I setup a Fleet Agent Policy that will process the docker log json files for different autodiscovered Docker container apps (eg. Apache HTTP, MySQL, Spring Boot App)?

Example filebeat autodiscover setup:

```auto
filebeat.autodiscover:
  # List of enabled autodiscover providers
  providers:
    - type: docker
      templates:
        - condition:
            equals.docker.container.labels.com.docker.compose.service: apache
          config:
            - module: apache
              access:
                input:
                  type: container
                  stream: stdout
                  paths:
                    - "/var/lib/docker/containers/${data.docker.container.id}/*-json.log"
              error:
                input:
                  type: container
                  stream: stderr
                  paths:
                    - "/var/lib/docker/containers/${data.docker.container.id}/*-json.log"
        - condition:
            equals.docker.container.labels.com.docker.compose.service: webapp
          config:
            - type: container
              paths:
                - "/var/lib/docker/containers/${data.docker.container.id}/*-json.log"
              multiline.pattern: '^[[:space:]]+(at|\.{3})\b|^Caused by:'
              multiline.negate: false
              multiline.match: after
        - condition:
            equals.docker.container.labels.com.docker.compose.service: mysql
          config:
            - module: mysql
              error:
                input:
                  type: container
                  paths:
                    - "/var/lib/docker/containers/${data.docker.container.id}/*-json.log"
              slowlog: 
                enabled: false
                

```

---

<div class="post-metadata">

### Author: ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)
#### Post date: [September 19, 2024, 5:58pm UTC](https://discuss.elastic.co/t/migrate-filebeat-autodiscover-for-docker-containers-to-fleet-managed-elastic-agent-setup/366162/2 "2024-09-19T17:58:42Z")

</div>

Hey @piers.geyman, welcome to discuss 🙂

Support for conditional configurations is limited at the moment in Fleet, there is an open discussion about this in [[Meta][Fleet] Offer a UI for input conditions · Issue #108525 · elastic/kibana · GitHub](https://github.com/elastic/kibana/issues/108525)

Though there are more options for that in Standalone Agent: [Install standalone Elastic Agents | Fleet and Elastic Agent Guide [8.15] | Elastic](https://www.elastic.co/guide/en/fleet/8.15/install-standalone-elastic-agent.html)
