Elasticsearch running in a docker container: How identify it as target for log events?

Dear community,
I am askig myself this: I have as test a docker-compose.yml up & running with 5 nodes - 3 es node, 1 kibana, 1 logstash. Each and everyone in its container. So far so good. Now I wanted to send from a vm a log event to that cluster. To do so, I need the ip of the receiving, dockerized node - could be that of an esnode for a beat sending or that one of the container with logstash inside.
My question is: I presume the IPs of containers are somehow dynamic. Then how can I address a dockerized node? Fixed IPs in a docker container??? Surely I am not the first to have this question.
The point is: the sending agent not being part of that single docker-compose.yml does not 'know' and can't address just so via name the dockerized services.
How do You did this? If you need more details, I am happy to provide them.
Kind regards

PS: Idea: Perhaps just using the IP of the host containing the docker containers? If so, are there better alternatives?
PPS: Yep. It worked with the host IP - Do you have better solutions?


Port-forwarding with host ip seems the simplest way to do this.

However, you could also try a front component with service discovery in order to route requests to your ES container, like Traefik.

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