How to add a new config file to logstash which is created by docker-compose?
I created my service with docker-compose and log stash is connected to kibana and elasticsearch.
Now I created a new config file for logstash but I don't know how to use it. I created the file in folder /elk/logstash/ in the host system. Unfortunately, all of the tutorials are based on the definition of the config file during the creation of the container, but I am seeking a way to update it after creation.
To make it more informative, I use ubuntu 22.04 in a VPS, and here is the docker-compose creation yml file:
version: '3.6'
services:
Elasticsearch:
image: elasticsearch:7.16.2
container_name: elasticsearch
restart: always
volumes:
- elastic_data:/usr/share/elasticsearch/data/
environment:
ES_JAVA_OPTS: "-Xmx256m -Xms256m"
discovery.type: single-node
ports:
- '9200:9200'
- '9300:9300'
networks:
- elk
Logstash:
image: logstash:7.16.2
container_name: logstash
restart: always
volumes:
- ./logstash/:/logstash_dir
command: logstash -f /logstash_dir/logstash.conf
depends_on:
- Elasticsearch
ports:
- '9600:9600'
environment:
LS_JAVA_OPTS: "-Xmx256m -Xms256m"
networks:
- elk
Kibana:
image: kibana:7.16.2
container_name: kibana
restart: always
ports:
- '5601:5601'
environment:
- ELASTICSEARCH_URL=http://elasticsearch:9200
depends_on:
- Elasticsearch
networks:
- elk
volumes:
elastic_data: {}
networks:
elk:
I executed the docker up in the /elk/ folder and now I have the file in the pipeline folder but I don't know how to trigger logstash to pick it while it is created. Please make sure your answer is not based on the creation of the container again by "docker-compose up" which is not my point. Thanks