title: How to run multi pipeline in logstash using The Elastic stack (ELK) powered by Docker and Compose
body: <p>I am using  <a href="https://github.com/deviantony/docker-elk" rel="nofollow noreferrer">this_repo</a> to get started running ELK with Docker.</p>
  
  <p>my question is regarding the logstash image in the docker-compose file:</p>
  
  <p>When I run locally I have 3 files <br/></p>
  
  <pre><code>#general settings
  logstash.yml
  #pipeline setting
  pipeline.yml
  #a pipe line configuration
  myconf.conf1
  </code></pre>
  
  <p>when I want to use multi pipeline I use the pipeline.yml file to control all the different pipeline I am running </p>
  
  <pre><code># Example of my pipeline.yml
  - pipeline.id: my-first-pipeline
    path.config: "/etc/logstash/my-first-pipeline.config"
    pipeline.workers: 2
  - pipeline.id: super-swell-pipeline
    path.config: "/etc/logstash/super-swell-pipeline.config"
    queue.type: persisted
  </code></pre>
  
  <p>In the repo I am using as guideline I can only find logstash.yml
  and I am not understanding how to can I add pipelines.
  the only running pipeline is the default "main" which by default only run logstash.conf
  I tried different configurations, all field</p>
  
  <p>How can I add pipeline.yml to the docker?
  or what is the best practice running multi pipelines with this docker-compose file?</p>
  
  <p>appreciate any help</p>
  
  <p>docker-compose/logstash form the repo:</p>
  
  <pre><code>  logstash:
      build:
        context: logstash/
        args:
          ELK_VERSION: $ELK_VERSION
      volumes:
        - type: bind
          source: ./logstash/config/logstash.yml
          target: /usr/share/logstash/config/logstash.yml
          read_only: true
        - type: bind
          #can be either a host path or volume name.
          source: ./logstash/pipeline
          #is the container path where the volume is mounted
          target: /usr/share/logstash/pipeline
          read_only: true
      ports:
        - "5000:5000/tcp"
        - "5000:5000/udp"
        - "9600:9600"
      environment:
        LS_JAVA_OPTS: "-Xmx256m -Xms256m"
      networks:
        - elk
      depends_on:
        - elasticsearch
  </code></pre>
  
  <p>DockerFILE:</p>
  
  <pre><code>ARG ELK_VERSION
  
  # https://www.docker.elastic.co/
  FROM docker.elastic.co/logstash/logstash:${ELK_VERSION}
  
  # Add your logstash plugins setup here
  # Example: RUN logstash-plugin install logstash-filter-json
  </code></pre>
  
  <p>logstash.yml</p>
  
  <pre><code>## Default Logstash configuration from Logstash base image.
  ## https://github.com/elastic/logstash/blob/master/docker/data/logstash/config/logstash-full.yml
  #
  http.host: "0.0.0.0"
  xpack.monitoring.elasticsearch.hosts: [ "http://elasticsearch:9200" ]
  
  ## X-Pack security credentials
  #
  xpack.monitoring.enabled: false
  xpack.monitoring.elasticsearch.username: elastic
  xpack.monitoring.elasticsearch.password: changeme
  </code></pre>