Docker compose connect to network bridge and host at same time

Hi everyon,
I’m running docker-compose version 1.23.2 and Docker version 19.03.5, build 633a0ea838 on Linux ubuntu 18.
I’m building elasticsearch, kibana and logstash container and i connect each other by using network bridge. But i also want to connect logstash with postgresql installed in local (localhost:5432).
docker-compose.yml:
version: ‘3.2’

services:
elasticsearch:
build:
context: elasticsearch/
args:
ELK_VERSION: $ELK_VERSION
volumes:
- type: bind
source: ./elasticsearch/config/elasticsearch.yml
target: /usr/share/elasticsearch/config/elasticsearch.yml
read_only: true
- type: volume
source: elasticsearch
target: /usr/share/elasticsearch/data
ports:
- “9200:9200”
- “9300:9300”
environment:
ES_JAVA_OPTS: “-Xmx256m -Xms256m”
ELASTIC_PASSWORD: changeme
networks:
- elk

logstash:
image: logstash-image
ports:
- “5000:5000”
- “9600:9600”
network_mode: “host”
depends_on:
- elasticsearch

kibana:
build:
context: kibana/
args:
ELK_VERSION: $ELK_VERSION
volumes:
- type: bind
source: ./kibana/config/kibana.yml
target: /usr/share/kibana/config/kibana.yml
read_only: true
ports:
- “5601:5601”
networks:
- elk
depends_on:
- elasticsearch

networks:
elk:
driver: bridge

volumes:
elasticsearch:

My problem is logstash can’t connect to 2 network at the same time. 'network_mode' and 'networks' cannot be combined

Do you have any idea, or another approach ?
Thank you a lot.