awesome-compose/elasticsearch-logstash-kibana
Chad Metcalf 702ec96821
Adding a Makefile and basic tests.
This approach uses bats to create a generic docker-compose test. It
checks that images are pullable, projects are buildable, up works, and
if ports are exposed that something is listening.

The tests can be tailored for each example. As long as they are the same
though, you can edit lib/test.bats.example and then `make update-tests`
and all the tests will be synced.

Signed-off-by: Chad Metcalf <chad@docker.com>
2020-08-08 14:26:52 -07:00
..
logstash Add Logstash config to filter example Nginx logs 2020-07-24 02:32:09 +02:00
docker-compose.yml Add Logstash config to filter example Nginx logs 2020-07-24 02:32:09 +02:00
README.md Add Logstash config to filter example Nginx logs 2020-07-24 02:32:09 +02:00
test.bats Adding a Makefile and basic tests. 2020-08-08 14:26:52 -07:00

Compose sample application

Elasticsearch, Logstash, and Kibana (ELK) in single-node

Project structure:

.
└── docker-compose.yml

docker-compose.yml

services:
  elasticsearch:
    image: elasticsearch:7.8.0
    ...
  logstash:
    image: logstash:7.8.0
    ...
  kibana:
    image: kibana:7.8.0
    ...

Deploy with docker-compose

$ docker-compose up -d
Creating network "elasticsearch-logstash-kibana_elastic" with driver "bridge"
Creating es ... done
Creating log ... done
Creating kib ... done

Expected result

Listing containers must show three containers running and the port mapping as below:

$ docker ps
CONTAINER ID        IMAGE                 COMMAND                  CREATED             STATUS                    PORTS                                                                                            NAMES
173f0634ed33        logstash:7.8.0        "/usr/local/bin/dock…"   43 seconds ago      Up 41 seconds             0.0.0.0:5000->5000/tcp, 0.0.0.0:5044->5044/tcp, 0.0.0.0:9600->9600/tcp, 0.0.0.0:5000->5000/udp   log
b448fd3e9b30        kibana:7.8.0          "/usr/local/bin/dumb…"   43 seconds ago      Up 42 seconds             0.0.0.0:5601->5601/tcp                                                                           kib
366d358fb03d        elasticsearch:7.8.0   "/tini -- /usr/local…"   43 seconds ago      Up 42 seconds (healthy)   0.0.0.0:9200->9200/tcp, 0.0.0.0:9300->9300/tcp                                                   es

After the application starts, navigate to below links in your web browser:

Stop and remove the containers

$ docker-compose down

Attribution

The example Nginx logs are copied from here.