How to run multiple instances in docker container?

I want to run multiple config files in docker container.
pipelines.yml file :

- pipeline.id: main
  path.config: "/usr/share/logstash/config/conf.d/*.conf"

- pipeline.id: i2c_req_res
  path.config: "/usr/share/logstash/config/conf.d.i2c_req_res/*.conf"

- pipeline.id: flinks
  path.config: "/usr/share/logstash/config/conf.d.flinks/*.conf"

- pipeline.id: engines
  path.config: "/usr/share/logstash/config/conf.d.engines/*.conf"

Now I am wondering how to run file. Is it way to define pipeline.id name in the config file or not.

If I'm good understood You want to run multiple config file under one pipeline.id? What are the intentions of this?

-> It's seems that You have a right config in yaml file.

You can run such docker container through docker-compose
an example file:

more docker-compose.yml
version: "3"
services:
  logstash_name:
    image: docker.elastic.co/logstash/logstash:7.16.1
    ports:
      - "9610:9600"
      - "9201:9200"
      - "5050:5044"
    volumes:
      - /home/test/docker/pipeline/:/usr/share/logstash/pipeline/
      - /home/test/docker/conf/jvm.options:/usr/share/logstash/config/jvm.options
      - /home/test/docker/conf/pipelines.yml:/usr/share/logstash/config/pipelines.yml
      - /home/test/docker/conf/logstash.yml:/usr/share/logstash/config/logstash.yml
      - /home/test/test/:/elastic/
      - /home/mstestdr/docker/sincedb/:/usr/share/logstash/sincedb/
    logging:
      driver: "json-file"
      options:
        max-size: "1g"
        max-file: "10"

Yes Dear, I want to run multiple config file.

so You have already defined name of pipeline.id in pipeline.yml it should work as You intended

1 Like

Dear I found alternate of this I just used if condition in each config file. Now it not conflicting with each other. I am not getting pipeline.id method.

Thanks For Response Dear.

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