mirror of
https://github.com/marcel-dempers/docker-development-youtube-series.git
synced 2025-06-06 17:01:30 +00:00
fluentd intro
This commit is contained in:
parent
b43943a058
commit
5cd2b71a85
@ -0,0 +1,24 @@
|
|||||||
|
# This source gets incoming logs over HTTP and sends them to elastic search
|
||||||
|
<source>
|
||||||
|
@type http
|
||||||
|
port 9880
|
||||||
|
bind 0.0.0.0
|
||||||
|
body_size_limit 32m
|
||||||
|
keepalive_timeout 10s
|
||||||
|
</source>
|
||||||
|
|
||||||
|
<match http-*.log>
|
||||||
|
@type elasticsearch
|
||||||
|
host elasticsearch
|
||||||
|
port 9200
|
||||||
|
index_name fluentd
|
||||||
|
type_name fluentd
|
||||||
|
</match>
|
||||||
|
|
||||||
|
<match file-myapp.log>
|
||||||
|
@type elasticsearch
|
||||||
|
host elasticsearch
|
||||||
|
port 9200
|
||||||
|
index_name fluentd
|
||||||
|
type_name fluentd
|
||||||
|
</match>
|
@ -1,3 +1,6 @@
|
|||||||
|
@include elastic-fluent.conf
|
||||||
|
################################################################
|
||||||
|
|
||||||
# This source reads tail of a file
|
# This source reads tail of a file
|
||||||
<source>
|
<source>
|
||||||
@type tail
|
@type tail
|
||||||
|
@ -3,7 +3,9 @@ services:
|
|||||||
fluentd:
|
fluentd:
|
||||||
container_name: fluentd
|
container_name: fluentd
|
||||||
user: root
|
user: root
|
||||||
image: fluent/fluentd:v1.11-debian
|
build:
|
||||||
|
context: .
|
||||||
|
image: fluentd
|
||||||
volumes:
|
volumes:
|
||||||
- /var/lib/docker/containers:/fluentd/log/containers # Example: Reading docker logs
|
- /var/lib/docker/containers:/fluentd/log/containers # Example: Reading docker logs
|
||||||
- ./file:/app/ #Example: Reading logs from a file
|
- ./file:/app/ #Example: Reading logs from a file
|
||||||
@ -25,4 +27,23 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ./file:/app
|
- ./file:/app
|
||||||
command: [ /bin/sh , -c , "apk add --no-cache curl && chmod +x /app/write-file-log.sh && ./app/write-file-log.sh"]
|
command: [ /bin/sh , -c , "apk add --no-cache curl && chmod +x /app/write-file-log.sh && ./app/write-file-log.sh"]
|
||||||
|
elasticsearch: # port 9200
|
||||||
|
image: elasticsearch:7.9.1
|
||||||
|
container_name: elasticsearch
|
||||||
|
environment:
|
||||||
|
- node.name=elasticsearch
|
||||||
|
- cluster.initial_master_nodes=elasticsearch
|
||||||
|
- bootstrap.memory_lock=true
|
||||||
|
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
|
||||||
|
ulimits:
|
||||||
|
memlock:
|
||||||
|
soft: -1
|
||||||
|
hard: -1
|
||||||
|
kibana:
|
||||||
|
image: kibana:7.9.1
|
||||||
|
container_name: kibana
|
||||||
|
ports:
|
||||||
|
- "5601:5601"
|
||||||
|
environment:
|
||||||
|
ELASTICSEARCH_URL: http://elasticsearch:9200
|
||||||
|
ELASTICSEARCH_HOSTS: http://elasticsearch:9200
|
5
monitoring/logging/fluentd/introduction/dockerfile
Normal file
5
monitoring/logging/fluentd/introduction/dockerfile
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
FROM fluent/fluentd:v1.11-debian
|
||||||
|
|
||||||
|
USER root
|
||||||
|
RUN gem install fluent-plugin-elasticsearch
|
||||||
|
USER fluent
|
Loading…
x
Reference in New Issue
Block a user