File tree Expand file tree Collapse file tree 2 files changed +7
-28
lines changed Expand file tree Collapse file tree 2 files changed +7
-28
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- ELK_VERSION=" 5.6.10"
4
3
NGINX_VERSION=" 1.15.2"
5
4
6
- # 1. First let's start Elasticsearch
5
+ # 1. First let's start our ELK-Stack
6
+ docker-compose up -d
7
7
8
- docker run -d --rm --name elasticsearch \
9
- elasticsearch:$ELK_VERSION
10
-
11
- # 2. Now we can start logstash (host from config has to match link)
12
-
13
- docker build -t mylogstash ./logstash
14
-
15
- docker run -d --rm --name logstash \
16
- --link elasticsearch:elasticsearch \
17
- mylogstash
18
-
19
- # 3. Let's run Kibana
20
- # If you want to check it out go to http://localhost:5601
21
- # Don't forget to create an Index pattern
22
-
23
- docker run -d --rm --name kibana \
24
- --link elasticsearch:elasticsearch \
25
- -p 5601:5601 \
26
- kibana:$ELK_VERSION
27
-
28
- # 4. Finally let's start our webserver
29
- # Note that logging can not be connected via Link
30
- # --> this will not work in a Docker-Compose File
31
- # Except $LOGSTASH_ADDRESS is defined as environment variable
32
-
33
- LOGSTASH_ADDRESS=$( docker inspect --format ' {{ .NetworkSettings.IPAddress }}' logstash)
8
+ # this could be exported to a environment variable
9
+ LOGSTASH_ADDRESS=$( docker inspect --format=' {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' nginxelk_logstash_1)
34
10
11
+ # 2. Now let's start a test application
12
+ # 2.1 try to query http://localhost and some wrong url's
13
+ # 2.2 set up an index on http://localhost:5601
35
14
docker run -d --rm --name nginx \
36
15
--log-driver=gelf \
37
16
--log-opt gelf-address=udp://$LOGSTASH_ADDRESS :12201 \
You can’t perform that action at this time.
0 commit comments