Connecting external applications
This page describes how to consume the ELK services from applications started outside of the ELK stack Compose.
General procedure
About the default bridge network
Docker Compose creates a bridge network used by the services from the ELK stack. This network is named after the directory that contains the docker-compose.yml file (without hyphens or underscores), followed by the predefined network name _elk.
For instance, if you cloned the repository inside a directory called elk-stack, the name of the bridge network dedicated to the ELK stack will be elkstack_elk.
To list the networks available to Docker, execute the following command:
Connecting containers to an arbitrary network
In order to be able to communicate with the services from the ELK stack, external containers must be connected to the same bridge network as the one used by these services.
From the Docker CLI, this translates to:
In a Docker Compose file, one can specify external networks in order to use networks created outside of the current Compose:
In both cases, one can verify that the name of the ELK services can actually be resolved from the newly created container:
Examples
Cerebro
Cerebro is a web administration tool for Elasticsearch. It replaces the older kopf plugin.
Launch the application with the following Docker Compose file:
Open your browser at the following address: http://localhost:9000, and use the following host address in the Hosts field: http://elasticsearch:9200.
