# Running filebeat as a docker image

**URL:** https://discuss.elastic.co/t/running-filebeat-as-a-docker-image/187402
**Category:** Beats
**Tags:** filebeat
**Created:** [June 25, 2019, 5:45pm UTC](https://discuss.elastic.co/t/running-filebeat-as-a-docker-image/187402 "2019-06-25T17:45:58Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![exocore123](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/exocore123/32/45130_2.png) [@exocore123](https://discuss.elastic.co/u/exocore123)
#### Post date: [June 25, 2019, 5:45pm UTC](https://discuss.elastic.co/t/running-filebeat-as-a-docker-image/187402/1 "2019-06-25T17:45:59Z")

</div>

Hello all,

Currently I am trying to implement filebeat into an EC2 instance to do logshipping from this ec2 instance to another ec2 (that is the kafka's).

```
ContainerDefinitions:
        -
          Name: !Ref service
          Image: !Ref repoPath
          Memory: !Ref memoryApp
          PortMappings:
            - ContainerPort: !Ref port
          Environment:
            - Name: JAVA_GC_OPTS
              Value: !Ref jvmFlags
            - Name: JAVA_XMX
              Value: !Ref javaXmx
            - Name: JAVA_XMS
              Value: !Ref javaXms
          LogConfiguration:
            LogDriver: awslogs
            Options:
              awslogs-group: !Ref logGroup
              awslogs-region: !Ref AWS::Region
        - !If
          - needLogger
          - Name: !Sub ${service}-filebeat
            Image: !Ref pathToLogger
            Memory: 512
            Environment:
              - Name: output.kafka.hosts
                Value: '["12.123.123.123:2181","12.123.123.124:2181","12.123.123.125:2181"]'
              - Name: output.kafka.topic
                Value: !Sub preprocess.splunk.${service}
              - Name: filebeats.inputs.paths
                Value: /app/logs/*
            VolumesFrom:
              - ReadOnly: true
                SourceContainer: !Ref service
            LogConfiguration:
              LogDriver: awslogs
              Options:
                awslogs-group: !Ref logGroup
                awslogs-region: !Ref AWS::Region
          - Ref: AWS::NoValue

```

Is there alternative methods to state the logs location and outputs for filebeat? I read the documentations that we should use the filebeat.yml, but I am looking for a more generic way to give these inputs instead of having to config a filebeat.yml for each of our services using this template

---

<div class="post-metadata">

### Author: ![exocore123](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/exocore123/32/45130_2.png) [@exocore123](https://discuss.elastic.co/u/exocore123)
#### Post date: [June 25, 2019, 6:42pm UTC](https://discuss.elastic.co/t/running-filebeat-as-a-docker-image/187402/2 "2019-06-25T18:42:28Z")

</div>

I guess another way to do this is to build a new entry point using filebeat as a base image?

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 23, 2019, 6:42pm UTC](https://discuss.elastic.co/t/running-filebeat-as-a-docker-image/187402/3 "2019-07-23T18:42:29Z")

</div>

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