-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
97 lines (80 loc) · 1.78 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
Add this content ot logstash.conf file
input {
tcp {
port => 5000
codec => json
}
file {
type => "doc"
# Logstash insists on absolute paths...
path => "/var/log/application.log"
codec => "json"
}
}
filter {
geoip {
source => "clientip"
target => "geoip"
}
if [message] =~ "\tat" {
grok {
match => ["message", "^(\tat)"]
add_tag => ["stacktrace"]
}
}
}
output {
stdout {
codec => rubydebug
}
elasticsearch {
hosts => ["http://elasticsearch:9200"]
index => "%{appname}"
}
}
Now add the below content to docker-compose.yml
version: "3"
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.8.1
restart: unless-stopped
environment:
- discovery.type=single-node
- xpack.security.enabled=false
- XPACK_REPORTING_ENABLED=false
- XPACK_MONITORING_ENABLED=false
ports:
- "9200:9200"
- "9300:9300"
networks:
- logging-network
logstash:
image: docker.elastic.co/logstash/logstash:7.8.1
restart: unless-stopped
depends_on:
- elasticsearch
environment:
- XPACK_SECURITY_ENABLED=false
- XPACK_REPORTING_ENABLED=false
- XPACK_MONITORING_ENABLED=false
- ELASTIC_HOST=elasticsearch:9200
ports:
- 5000:5000
volumes:
- /root/logstash.conf:/usr/share/logstash/config/logstash.conf:ro
- /root/logstash.conf:/usr/share/logstash/pipeline/logstash.conf:ro
networks:
- logging-network
kibana:
image: docker.elastic.co/kibana/kibana:7.8.1
restart: unless-stopped
depends_on:
- logstash
ports:
- 5601:5601
networks:
- logging-network
networks:
logging-network:
driver: bridge
Start the containers using docker-compose up -d